Slight logic reordering in JSImmediate::from(double)
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2007 23:39:39 +0000 (23:39 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2007 23:39:39 +0000 (23:39 +0000)
Reviewed by Geoff.

This gives a 0.1% improvement in SunSpider.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28916 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/kjs/JSImmediate.h

index 4b52650..94a13e9 100644 (file)
@@ -1,3 +1,14 @@
+2007-12-20  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoff.
+
+        Slight logic reordering in JSImmediate::from(double)
+
+        This gives a 0.1% improvement in SunSpider.
+
+        * kjs/JSImmediate.h:
+        (KJS::JSImmediate::from):
+
 2007-12-20  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Geoff, then re-rubber-stamped by Geoff after final search/replace and testing.
index 049b4c7..bc0cb16 100644 (file)
@@ -234,7 +234,7 @@ ALWAYS_INLINE JSValue* JSImmediate::from(double d)
         return 0;
 
     // Check for data loss from conversion to int.
-    if ((intVal != d) || (signbit(d) && !intVal))
+    if ((intVal != d) || (!intVal && signbit(d)))
         return 0;
 
     return tag(intVal << 2, NumberType);