llogiq / bytecount

Counting occurrences of a given byte or UTF-8 characters in a slice of memory – fast
Apache License 2.0
225 stars 26 forks source link

Some minor style cleanup #15

Closed pthariensflame closed 7 years ago

pthariensflame commented 7 years ago

None of this should really change anything, but in principle it could allow the compiler to optimize slightly better. :)

More to the point, it makes better use of the standard library’s facilities for slice manipulation, which I feel makes the code clearer. In addition, it uses the named constant usize::MAX in place of the max_value method, which makes it clearer that the value in question really is a compile-time constant.

llogiq commented 7 years ago

Thank you! On my machine, it actually produces slightly better code. I'll wait for CI to finish before merging.

pthariensflame commented 7 years ago

Thanks!