Title: [184594] trunk/Websites/perf.webkit.org
Revision
184594
Author
[email protected]
Date
2015-05-19 14:49:59 -0700 (Tue, 19 May 2015)

Log Message

Build fix. Don't fall into an infinite loop when value (renamed from bytes) is zero.

* public/v2/manifest.js:
(App.Manifest.Ember.Controller.extend.):
(App.Manifest.Ember.Controller.extend):

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (184593 => 184594)


--- trunk/Websites/perf.webkit.org/ChangeLog	2015-05-19 21:46:54 UTC (rev 184593)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2015-05-19 21:49:59 UTC (rev 184594)
@@ -1,5 +1,13 @@
 2015-05-19  Ryosuke Niwa  <[email protected]>
 
+        Build fix. Don't fall into an infinite loop when value (renamed from bytes) is zero.
+
+        * public/v2/manifest.js:
+        (App.Manifest.Ember.Controller.extend.):
+        (App.Manifest.Ember.Controller.extend):
+
+2015-05-19  Ryosuke Niwa  <[email protected]>
+
         Don't show unit (bytes) separaetly from SI suffixes (K, M, etc...)
         https://bugs.webkit.org/show_bug.cgi?id=145181
 

Modified: trunk/Websites/perf.webkit.org/public/v2/manifest.js (184593 => 184594)


--- trunk/Websites/perf.webkit.org/public/v2/manifest.js	2015-05-19 21:46:54 UTC (rev 184593)
+++ trunk/Websites/perf.webkit.org/public/v2/manifest.js	2015-05-19 21:49:59 UTC (rev 184594)
@@ -326,15 +326,15 @@
 
         var suffix = ['\u03BC', 'm', '', 'K', 'M', 'G', 'T', 'P', 'E'];
         var threshold = sigFig >= 3 ? divisor : (divisor / 10);
-        return function (bytes) {
+        return function (value) {
             var i;
-            var sign = bytes >= 0 ? (alwaysShowSign ? '+' : '') : '-';
-            bytes = Math.abs(bytes);
-            for (i = isMiliseconds ? 1 : 2; bytes < 1; i--)
-                bytes *= divisor;
-            for (; bytes >= threshold; i++)
-                bytes /= divisor;
-            return sign + bytes.toPrecision(Math.max(2, sigFig)) + ' ' + suffix[i] + (unit || '');
+            var sign = value >= 0 ? (alwaysShowSign ? '+' : '') : '-';
+            value = Math.abs(value);
+            for (i = isMiliseconds ? 1 : 2; value < 1 && i > 0; i--)
+                value *= divisor;
+            for (; value >= threshold; i++)
+                value /= divisor;
+            return sign + value.toPrecision(Math.max(2, sigFig)) + ' ' + suffix[i] + (unit || '');
         }
     },
     _formatFetchedData: function (metricName, configurations)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to