Commits

Bryan O'Sullivan  committed 06c233a

Refactor time scaling.

  • Participants
  • Parent commits bc7b65b

Comments (0)

Files changed (1)

File templates/js/jquery.criterion.js

 
   $.scaleTimes = function(ary) {
     var s = $.timeUnits($.mean(ary));
+    return [$.scaleBy(s[0], ary), s[1]];
+  };
+
+  $.scaleBy = function(x, ary) {
     var nary = new Array(ary.length);
     for (var i = 0; i < ary.length; i++)
-      nary[i] = ary[i] * s[0];
-    return [nary, s[1]];
+      nary[i] = ary[i] * x;
+    return nary;
   };
 
   $.renderTime = function(text) {