Permalink
Browse files

Making isProperX() methods in Set more efficient by doing the size ch…

…eck first.
  • Loading branch information...
1 parent ece1160 commit d9e0a9de764023a20249ad9fcfe7e01546fd185f @jcoglan jcoglan committed Aug 8, 2008
Showing with 2 additions and 4 deletions.
  1. +2 −4 source/set.js
View
@@ -102,13 +102,11 @@ JS.Set = new JS.Class({
},
isProperSubset: function(other) {
- return this.isSubset(other) &&
- this._members.length < other._members.length;
+ return this._members.length < other._members.length && this.isSubset(other);
},
isProperSuperset: function() {
- return this.isSuperset(other) &&
- this._members.length > other._members.length;
+ return this._members.length > other._members.length && this.isSuperset(other);
},
isSubset: function(other) {

0 comments on commit d9e0a9d

Please sign in to comment.