Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…eck first.
  • Loading branch information...
commit d9e0a9de764023a20249ad9fcfe7e01546fd185f 1 parent ece1160
@jcoglan jcoglan authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 source/set.js
View
6 source/set.js
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.