483019. no need for Math.abs when multiplying two numbers together. r=gavin
authorDoug Turner <dougt@meer.net>
Fri, 13 Mar 2009 14:11:02 -0700
changeset 65120 1071e8eb99794a9d5303df81a68d5c6522ae8de7
parent 65119 ce6fad957a24f7bc00abaf28314067f366914ae4
child 65121 bb995ae17c7921478286035517133c0909526157
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs483019
483019. no need for Math.abs when multiplying two numbers together. r=gavin
mobile/chrome/content/InputHandler.js
--- a/mobile/chrome/content/InputHandler.js
+++ b/mobile/chrome/content/InputHandler.js
@@ -330,17 +330,17 @@ ChromeInputModule.prototype = {
 
     aEvent.stopPropagation();
     aEvent.preventDefault();
 
     let dx = dragData.sX - aEvent.screenX;
     let dy = dragData.sY - aEvent.screenY;
 
     if (!dragData.dragging && dragData.dragStartTimeout != -1) {
-      if ((Math.abs(dx*dx) + Math.abs(dy*dy)) > 100) {
+      if (dx*dx + dy*dy > 100) {
         clearTimeout(dragData.dragStartTimeout);
         this._dragStart(aEvent.screenX, aEvent.screenY);
       }
     }
     if (!dragData.dragging)
       return;
 
     this._dragMove(aEvent.screenX, aEvent.screenY);
@@ -541,17 +541,17 @@ ContentPanningModule.prototype = {
       return;
 
     let dragData = this._dragData;
 
     let dx = dragData.sX - aEvent.screenX;
     let dy = dragData.sY - aEvent.screenY;
 
     if (!dragData.dragging && dragData.dragStartTimeout != -1) {
-      if ((Math.abs(dx*dx) + Math.abs(dy*dy)) > 100) {
+      if (dx*dx + dy*dy > 100) {
         clearTimeout(dragData.dragStartTimeout);
         this._dragStart(aEvent.screenX, aEvent.screenY);
       }
     }
     if (!dragData.dragging)
       return;
 
     this._dragMove(aEvent.screenX, aEvent.screenY);