String compare in words?
Era Scarecrow via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 29 10:27:09 PDT 2016
On Sunday, 29 May 2016 at 17:13:49 UTC, qznc wrote:
> Given two string (or char[] or ubyte[]) objects, I want to
> compare them. The naive loop accesses the arrays byte-wise. How
> could I turn this into a word-wise compare for better
> performance?
>
> Is a cast into size_t[] ok? Some Phobos helper functions?
Assuming you don't have codepoints and only want to do a raw
compare, i believe you can as long as the sizes align.
More information about the Digitalmars-d-learn
mailing list