Title: [103202] trunk/Source/_javascript_Core
Revision
103202
Author
benja...@webkit.org
Date
2011-12-18 18:03:50 -0800 (Sun, 18 Dec 2011)

Log Message

Remove the duplicated code from ASCIICType.h
https://bugs.webkit.org/show_bug.cgi?id=74771

Patch by Benjamin Poulain <bpoul...@apple.com> on 2011-12-18
Reviewed by Andreas Kling.

Use isASCIIDigit() and isASCIIAlpha() instead of copying the code.

* wtf/ASCIICType.h:
(WTF::isASCIIDigit):
(WTF::isASCIIAlphanumeric):
(WTF::isASCIIHexDigit):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (103201 => 103202)


--- trunk/Source/_javascript_Core/ChangeLog	2011-12-19 01:47:34 UTC (rev 103201)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-12-19 02:03:50 UTC (rev 103202)
@@ -1,3 +1,17 @@
+2011-12-18  Benjamin Poulain  <bpoul...@apple.com>
+
+        Remove the duplicated code from ASCIICType.h
+        https://bugs.webkit.org/show_bug.cgi?id=74771
+
+        Reviewed by Andreas Kling.
+
+        Use isASCIIDigit() and isASCIIAlpha() instead of copying the code.
+
+        * wtf/ASCIICType.h:
+        (WTF::isASCIIDigit):
+        (WTF::isASCIIAlphanumeric):
+        (WTF::isASCIIHexDigit):
+
 2011-12-18  Anders Carlsson  <ander...@apple.com>
 
         Set the main frame view scroll position asynchronously

Modified: trunk/Source/_javascript_Core/wtf/ASCIICType.h (103201 => 103202)


--- trunk/Source/_javascript_Core/wtf/ASCIICType.h	2011-12-19 01:47:34 UTC (rev 103201)
+++ trunk/Source/_javascript_Core/wtf/ASCIICType.h	2011-12-19 02:03:50 UTC (rev 103202)
@@ -53,19 +53,19 @@
     return (c | 0x20) >= 'a' && (c | 0x20) <= 'z';
 }
 
-template<typename CharType> inline bool isASCIIAlphanumeric(CharType c)
+template<typename CharType> inline bool isASCIIDigit(CharType c)
 {
-    return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z');
+    return c >= '0' && c <= '9';
 }
 
-template<typename CharType> inline bool isASCIIDigit(CharType c)
+template<typename CharType> inline bool isASCIIAlphanumeric(CharType c)
 {
-    return (c >= '0') & (c <= '9');
+    return isASCIIDigit(c) || isASCIIAlpha(c);
 }
 
 template<typename CharType> inline bool isASCIIHexDigit(CharType c)
 {
-    return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f');
+    return isASCIIDigit(c) || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f');
 }
 
 template<typename CharType> inline bool isASCIILower(CharType c)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to