Address code review comments
[dygraphs.git] / dygraph-utils.js
index 086d8f8..1d1623f 100644 (file)
@@ -818,7 +818,7 @@ Dygraph.createIterator = function(array, start, length, opt_predicate) {
 // From: http://paulirish.com/2011/requestanimationframe-for-smart-animating/
 // Should be called with the window context:
 //   Dygraph.requestAnimFrame.call(window, function() {})
-Dygraph.requestAnimFrame = (function(){
+Dygraph.requestAnimFrame = (function() {
   return window.requestAnimationFrame       ||
           window.webkitRequestAnimationFrame ||
           window.mozRequestAnimationFrame    ||
@@ -843,7 +843,7 @@ Dygraph.requestAnimFrame = (function(){
  * @private
  */
 Dygraph.repeatAndCleanup = function(repeatFn, maxFrames, framePeriodInMillis,
-  cleanupFn) {
+    cleanupFn) {
   var frameNumber = 0;
   var previousFrameNumber;
   var startTime = new Date().getTime();
@@ -873,7 +873,7 @@ Dygraph.repeatAndCleanup = function(repeatFn, maxFrames, framePeriodInMillis,
         repeatFn(maxFrameArg);  // Ensure final call with maxFrameArg.
         cleanupFn();
       } else {
-        if (frameDelta != 0) {  // Don't call repeatFn with duplicate frames.
+        if (frameDelta !== 0) {  // Don't call repeatFn with duplicate frames.
           repeatFn(frameNumber);
         }
         loop();
@@ -1029,7 +1029,6 @@ Dygraph.regularShape_ = function(
   delta = delta || Math.PI * 2 / sides;
 
   ctx.beginPath();
-  var first = true;
   var initialAngle = rotationRadians;
   var angle = initialAngle;