mention
mention copied to clipboard
Use hashmap for uniquify function
Your uniquify(in []string) function in mention.go uses O(n^2) time to collect unique strings. You could switch to using map[string]struct{} for a better O(n) performance.
Sounds good, I don't mind accepting a PR with this improvement.
Most of the time the input to uniquify() will be small. A map will be quite a lot slower. Last time I benchmarked it's not faster unless you have more than ~50 entries.
@arp242 ok. So, for the sake of future cases where the entries are many, should we switch to map? It covers both ends.