Make LowercaseStringViewLookupTranslator::Equal more efficient.
Doing multiple passes here is inefficient. It's more efficient to simply iterate through the characters and check that the lowercase version of each character in the query value equals the corresponding character in the bucket value. An early out for equal bytes is preserved, but must now check that those bytes are in fact not upper ASCII. Comments are added and variable names expanded for clarity, because it was previously difficult to discern what |str| and |buf| were. Bug: 1138487 Change-Id: I8219ce1594e39606b59513d5823dc107bb10656e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2481442 Commit-Queue: Jeremy Roman <jbroman@chromium.org> Reviewed-by:Albert J. Wong <ajwong@chromium.org> Cr-Commit-Position: refs/heads/master@{#825608}
Showing
Please register or sign in to comment