Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • 2
    This comparison advantage is only application for relational comparisons. For equality comparisons, length-prefixed strings will generally win out since strings of unequal length can be recognized as unequal without having to examine any of the content, and content comparison can be done using multi-byte chunks without having to stop as soon as a zero byte is found. Further, the advantage isn't really as great as you state since the scenario where the difference is zero will be true of all but the last loop iteration. Commented Sep 14, 2022 at 15:53