String compare in words?
Era Scarecrow via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 29 10:42:48 PDT 2016
On Sunday, 29 May 2016 at 17:38:17 UTC, Jonathan M Davis wrote:
> In what way are you trying to compare them? If all you're doing
> is comparing them for equality, then just use ==. e.g.
>
> if(str1 == str2)
> {
> }
>
> And if you're not simply comparing for equality, what are you
> looking to figure out? Without more information about what
> you're trying to do, it's kind of hard to help you.
I'm reminded that the GNU stdlib has a string compare function
which defaults to using larger double words to get a speedup, and
I think he wants to do that the same way. Although unless they
are both the same size and both divisible by the size of size_t,
then it's a multi-stage process to do correctly.
Worse I'm not sure if the code generation already does that and
possibly does a better job than what we could do by hand...
More information about the Digitalmars-d-learn
mailing list