From d9efb888bc7a460b810b02311c3a5fa7a0ce0a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 20 Feb 2014 15:37:38 +0100 Subject: [PATCH] Clean up Point#equals() code. --- src/basic/Point.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/basic/Point.js b/src/basic/Point.js index cbde7e87..b845b6bc 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -199,10 +199,11 @@ var Point = Base.extend(/** @lends Point# */{ * console.log(point != new Point(1, 1)); // true */ equals: function(point) { - return point === this || point && (this.x === point.x - && this.y === point.y - || Array.isArray(point) && this.x === point[0] - && this.y === point[1]) || false; + return this === point || point + && (this.x === point.x && this.y === point.y + || Array.isArray(point) + && this.x === point[0] && this.y === point[1]) + || false; }, /**