Title: [231864] trunk/Source/WTF
Revision
231864
Author
utatane....@gmail.com
Date
2018-05-16 12:46:22 -0700 (Wed, 16 May 2018)

Log Message

Unreviewed, follow-up after r231762
https://bugs.webkit.org/show_bug.cgi?id=185589

Addresses darin's suggestions to improve timeClip.

* wtf/DateMath.cpp:
(WTF::timeClip):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (231863 => 231864)


--- trunk/Source/WTF/ChangeLog	2018-05-16 19:39:30 UTC (rev 231863)
+++ trunk/Source/WTF/ChangeLog	2018-05-16 19:46:22 UTC (rev 231864)
@@ -1,3 +1,13 @@
+2018-05-16  Yusuke Suzuki  <utatane....@gmail.com>
+
+        Unreviewed, follow-up after r231762
+        https://bugs.webkit.org/show_bug.cgi?id=185589
+
+        Addresses darin's suggestions to improve timeClip.
+
+        * wtf/DateMath.cpp:
+        (WTF::timeClip):
+
 2018-05-14  Yusuke Suzuki  <utatane....@gmail.com>
 
         [Win] Use C++17 in MSVC

Modified: trunk/Source/WTF/wtf/DateMath.cpp (231863 => 231864)


--- trunk/Source/WTF/wtf/DateMath.cpp	2018-05-16 19:39:30 UTC (rev 231863)
+++ trunk/Source/WTF/wtf/DateMath.cpp	2018-05-16 19:46:22 UTC (rev 231864)
@@ -1155,11 +1155,9 @@
 
 double timeClip(double t)
 {
-    if (!std::isfinite(t))
+    if (std::abs(t) > maxECMAScriptTime)
         return std::numeric_limits<double>::quiet_NaN();
-    if (fabs(t) > maxECMAScriptTime)
-        return std::numeric_limits<double>::quiet_NaN();
-    return trunc(t) + 0.0;
+    return std::trunc(t) + 0.0;
 }
 
 // See http://tools.ietf.org/html/rfc2822#section-3.3 for more information.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to