Reminds me of the Mycroft parallel way to find null bytes. You might likehttps://github.com/erikcorry/struhchuh/blob/master/search2.cc …
-
-
-
Yup, pretty similar ideas, thanks for the link.
End of conversation
New conversation -
-
-
It fails a bit subtly if the input is not ASCII. Ie it works most of the time, but the sequence "\xFFz.." will not capitalize the 'z'. This is fixable with a few more bitops.
-
I actually enforce ASCII as an invariant elsewhere in the module, but yes.
End of conversation
New conversation -
-
-
Uppercase [a-z] -> [A-Z] 4 ascii chars packed inside 32 bit integer...? Looking at an ASCII table helps, also looking at a single byte, not all four. 'z' is 5 positions away from 127 (0x7F)...
-
That's it! I'll be releasing this as part of either as a "tinystr" crate or just a performance enhancement to fluent-locale-rs, haven't decided which yet.
- 5 more replies
New conversation -
-
-
It looks kinda like finding quickly (four at a time) if a byte string contains any byte in some range, but I’m surprised by the additions instead of some bit-wise operation.
-
ASCII lower-casing?
End of conversation
New conversation -
-
-
I had to try it, but it's a parallel to-upper. I'm going to have to think more about how it works now.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
When you need something capitalized and you need it NOW...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.