AdguardTeam / urlfilter

AdGuard content blocking library in golang
GNU General Public License v3.0
102 stars 21 forks source link

Remove two useless comparisons #10

Closed jvoisin closed 3 years ago

jvoisin commented 3 years ago

There is no point in checking if the domain ends with a string, then checking again if it ends with a string prefixed by a dot.

ameshkov commented 3 years ago

This is not useless, it avoids making an extra allocation when the first check returns false (and this is 99% of all cases).

Maybe we should add a comment about why it's being done, though.