[webkit-reviews] review granted: [Bug 75821] Using strncmp() for comparing scheme and port numbers is inefficient : [Attachment 124046] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 26 11:00:36 PST 2012
Darin Adler <darin at apple.com> has granted Benjamin Poulain
<benjamin at webkit.org>'s request for review:
Bug 75821: Using strncmp() for comparing scheme and port numbers is inefficient
https://bugs.webkit.org/show_bug.cgi?id=75821
Attachment 124046: Patch
https://bugs.webkit.org/attachment.cgi?id=124046&action=review
------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=124046&action=review
> Source/WebCore/platform/KURL.cpp:1079
> +template<size_t referenceLength>
> +static inline bool equal(const char* str, size_t length, const char
(&reference)[referenceLength])
> +{
> + return length == referenceLength && equal(str, reference);
> }
This compares two strings. It seems a little strange that the first string is
named “str” with length “length” and the second is named “reference” with name
“referenceLength”. I would just name them “a” and “b”, or “stringA” and
“stringB”, and “lengthA” and “lengthB”, or something like that.
More information about the webkit-reviews
mailing list