Streamline various #equals() methods.

This commit is contained in:
Jürg Lehni 2013-06-12 18:57:12 -07:00
parent 4a8469b740
commit 2196ef2a74
5 changed files with 13 additions and 8 deletions
src/basic

View file

@ -110,8 +110,10 @@ var Matrix = Base.extend(/** @lends Matrix# */{
* @return {Boolean} {@true if the matrices are equal}
*/
equals: function(mx) {
return mx && this._a == mx._a && this._b == mx._b && this._c == mx._c
&& this._d == mx._d && this._tx == mx._tx && this._ty == mx._ty;
return mx === this || mx && this._a == mx._a && this._b == mx._b
&& this._c == mx._c && this._d == mx._d && this._tx == mx._tx
&& this._ty == mx._ty
|| false;
},
/**