Using strncmp() for comparing scheme and port numbers is inefficient
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 20:09:40 +0000 (20:09 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 20:09:40 +0000 (20:09 +0000)
commit1ca1056f701c8c079ca6e87082504868f5cf4583
treeacf449fd88a2c88538ae8dd5e595dbd4bd19f733
parent864bbf71eaab5b257c2879871ff8120c59d12a7e
Using strncmp() for comparing scheme and port numbers is inefficient
https://bugs.webkit.org/show_bug.cgi?id=75821

Reviewed by Darin Adler.

Replace the equal() function comparing 2 arbitrary strings by a template
comparing the string to an array, character by character.

This is only used for small strings: the schemes and the ports.

* platform/KURL.cpp:
(WebCore::equal):
(WebCore::isDefaultPortForScheme):
(WebCore::isNonFileHierarchicalScheme):
(WebCore::isCanonicalHostnameLowercaseForScheme):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/KURL.cpp