Title: [164175] trunk/Source/WTF
Revision
164175
Author
[email protected]
Date
2014-02-15 10:15:16 -0800 (Sat, 15 Feb 2014)

Log Message

Remove 'static' specifier from free inline functions in StringImpl.h
https://bugs.webkit.org/show_bug.cgi?id=118554

Reviewed by Darin Adler.

At first 'static' does not bring any use here, secondly static free
inline functions in headers is a bad practice in general as each instance
of function defined as inline is treated as a separate function and each
instance has its own copy of static locals and string literals.

* wtf/text/StringImpl.h:
(WTF::codePointCompare):
(WTF::codePointCompare8):
(WTF::codePointCompare16):
(WTF::codePointCompare8To16):
(WTF::isSpaceOrNewline):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (164174 => 164175)


--- trunk/Source/WTF/ChangeLog	2014-02-15 18:00:22 UTC (rev 164174)
+++ trunk/Source/WTF/ChangeLog	2014-02-15 18:15:16 UTC (rev 164175)
@@ -1,3 +1,22 @@
+2014-02-15  Mikhail Pozdnyakov  <[email protected]>
+
+        Remove 'static' specifier from free inline functions in StringImpl.h
+        https://bugs.webkit.org/show_bug.cgi?id=118554
+
+        Reviewed by Darin Adler.
+
+        At first 'static' does not bring any use here, secondly static free
+        inline functions in headers is a bad practice in general as each instance
+        of function defined as inline is treated as a separate function and each
+        instance has its own copy of static locals and string literals.
+
+        * wtf/text/StringImpl.h:
+        (WTF::codePointCompare):
+        (WTF::codePointCompare8):
+        (WTF::codePointCompare16):
+        (WTF::codePointCompare8To16):
+        (WTF::isSpaceOrNewline):
+
 2014-02-14  Benjamin Poulain  <[email protected]>
 
         Improve the performance on mobile of FTPDirectoryDocument

Modified: trunk/Source/WTF/wtf/text/StringImpl.h (164174 => 164175)


--- trunk/Source/WTF/wtf/text/StringImpl.h	2014-02-15 18:00:22 UTC (rev 164174)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2014-02-15 18:15:16 UTC (rev 164175)
@@ -1297,7 +1297,7 @@
 }
 
 template<typename CharacterType1, typename CharacterType2>
-static inline int codePointCompare(unsigned l1, unsigned l2, const CharacterType1* c1, const CharacterType2* c2)
+inline int codePointCompare(unsigned l1, unsigned l2, const CharacterType1* c1, const CharacterType2* c2)
 {
     const unsigned lmin = l1 < l2 ? l1 : l2;
     unsigned pos = 0;
@@ -1316,22 +1316,22 @@
     return (l1 > l2) ? 1 : -1;
 }
 
-static inline int codePointCompare8(const StringImpl* string1, const StringImpl* string2)
+inline int codePointCompare8(const StringImpl* string1, const StringImpl* string2)
 {
     return codePointCompare(string1->length(), string2->length(), string1->characters8(), string2->characters8());
 }
 
-static inline int codePointCompare16(const StringImpl* string1, const StringImpl* string2)
+inline int codePointCompare16(const StringImpl* string1, const StringImpl* string2)
 {
     return codePointCompare(string1->length(), string2->length(), string1->characters16(), string2->characters16());
 }
 
-static inline int codePointCompare8To16(const StringImpl* string1, const StringImpl* string2)
+inline int codePointCompare8To16(const StringImpl* string1, const StringImpl* string2)
 {
     return codePointCompare(string1->length(), string2->length(), string1->characters8(), string2->characters16());
 }
 
-static inline int codePointCompare(const StringImpl* string1, const StringImpl* string2)
+inline int codePointCompare(const StringImpl* string1, const StringImpl* string2)
 {
     if (!string1)
         return (string2 && string2->length()) ? -1 : 0;
@@ -1351,7 +1351,7 @@
     return codePointCompare16(string1, string2);
 }
 
-static inline bool isSpaceOrNewline(UChar c)
+inline bool isSpaceOrNewline(UChar c)
 {
     // Use isASCIISpace() for basic Latin-1.
     // This will include newlines, which aren't included in Unicode DirWS.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to