@blackglory/structures 0.6.7 → 0.6.10
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.
- package/dist/es2015/index.min.mjs +1 -1
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +6 -5
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +6 -5
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +1 -1
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +1 -1
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +6 -5
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +6 -5
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +1 -1
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/sparse-set.js +6 -5
- package/lib/es2015/sparse-set.js.map +1 -1
- package/lib/es2018/sparse-set.js +6 -5
- package/lib/es2018/sparse-set.js.map +1 -1
- package/package.json +1 -1
package/dist/es2015/index.umd.js
CHANGED
|
@@ -9655,10 +9655,8 @@
|
|
|
9655
9655
|
get [Symbol.toStringTag]() {
|
|
9656
9656
|
return this.constructor.name;
|
|
9657
9657
|
}
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
yield value;
|
|
9661
|
-
}
|
|
9658
|
+
[Symbol.iterator]() {
|
|
9659
|
+
return this.values[Symbol.iterator]();
|
|
9662
9660
|
}
|
|
9663
9661
|
has(value) {
|
|
9664
9662
|
// 跟一般的实现不同, 不需要访问values数组.
|
|
@@ -9674,7 +9672,10 @@
|
|
|
9674
9672
|
remove(value) {
|
|
9675
9673
|
if (this.has(value)) {
|
|
9676
9674
|
const lastValue = this.values.pop();
|
|
9677
|
-
if (value
|
|
9675
|
+
if (value === lastValue) {
|
|
9676
|
+
this.valueToValueIndex[value] = undefined;
|
|
9677
|
+
}
|
|
9678
|
+
else {
|
|
9678
9679
|
const indexOfValue = this.valueToValueIndex[value];
|
|
9679
9680
|
this.values[indexOfValue] = lastValue;
|
|
9680
9681
|
this.valueToValueIndex[lastValue] = indexOfValue;
|