2 ms·
”Yes. The filter is only for a handful of swearwords, I wouldn't bother making it larger since people can easily circumvent it with various characters.” That’s
by Someone 7y ago
”Yes. The filter is only for a handful of swearwords, I wouldn't bother making it larger since people can easily circumvent it with various characters.”
That’s not the problem I mentioned. False positive means cases where your filter thinks it sees a swear word, while there is none. Cases where there are swear words that the code doesn’t detect are false negatives.
”Might be able to not have that defer statement at all”
That wouldn’t be robust. defer guarantees the file gets closed, no matter how the function is exited. That’s what you want (almost all the time). It’s the close just before returning that’s superfluous.