@blackglory/structures 0.6.7 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9655,8 +9655,10 @@ class SparseSet {
9655
9655
  }
9656
9656
  }
9657
9657
  has(value) {
9658
- // 跟一般的实现不同, 不需要访问values数组.
9659
- return es2018$e.isntUndefined(this.valueToValueIndex[value]);
9658
+ const index = this.valueToValueIndex[value];
9659
+ return es2018$e.isUndefined(index)
9660
+ ? false
9661
+ : this.values[index] === value;
9660
9662
  }
9661
9663
  add(value) {
9662
9664
  if (!this.has(value)) {
@@ -9672,8 +9674,6 @@ class SparseSet {
9672
9674
  const indexOfValue = this.valueToValueIndex[value];
9673
9675
  this.values[indexOfValue] = lastValue;
9674
9676
  this.valueToValueIndex[lastValue] = indexOfValue;
9675
- // 跟一般的实现不同, 直接删除值的索引.
9676
- this.valueToValueIndex[value] = undefined;
9677
9677
  }
9678
9678
  }
9679
9679
  }