unicode-categories icon indicating copy to clipboard operation
unicode-categories copied to clipboard

Duplicate condition on both sides of ||

Open H2CO3 opened this issue 7 years ago • 1 comments

In https://github.com/swgillespie/unicode-categories/blob/master/src/lib.rs#L182-L183:

            || self.is_punctuation_close()
            || self.is_punctuation_close()

The second one is redundant and should be removed.

H2CO3 avatar Aug 05 '17 20:08 H2CO3

The compiler will optimize this away from binary code, but the overall implementation is still slow. You might be interested in finl_unicode, which I just released on crates.io. It supports the latest Unicode standard and is 10–20 times faster than unicode-categories.

dahosek avatar Aug 30 '22 04:08 dahosek