@woosh/meep-engine 2.117.18 → 2.117.19
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/build/meep.cjs +115 -112
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +115 -112
- package/package.json +1 -1
- package/src/core/collection/map/HashMap.d.ts.map +1 -1
- package/src/core/collection/map/HashMap.js +110 -108
- package/src/engine/graphics/material/manager/ManagedTexture.d.ts +0 -3
- package/src/engine/graphics/material/manager/ManagedTexture.d.ts.map +0 -1
- package/src/engine/graphics/material/manager/ManagedTexture.js +0 -3
- package/src/engine/graphics/material/manager/TextureManager.d.ts +0 -3
- package/src/engine/graphics/material/manager/TextureManager.d.ts.map +0 -1
- package/src/engine/graphics/material/manager/TextureManager.js +0 -3
package/build/meep.module.js
CHANGED
|
@@ -59945,20 +59945,6 @@ function invokeObjectHash(object) {
|
|
|
59945
59945
|
return object.hash();
|
|
59946
59946
|
}
|
|
59947
59947
|
|
|
59948
|
-
/**
|
|
59949
|
-
* @template T
|
|
59950
|
-
* @param {T[]} array
|
|
59951
|
-
* @param {number} index0
|
|
59952
|
-
* @param {number} index1
|
|
59953
|
-
*/
|
|
59954
|
-
function array_swap_one(array, index0, index1) {
|
|
59955
|
-
|
|
59956
|
-
const t = array[index0];
|
|
59957
|
-
|
|
59958
|
-
array[index0] = array[index1];
|
|
59959
|
-
array[index1] = t;
|
|
59960
|
-
}
|
|
59961
|
-
|
|
59962
59948
|
/**
|
|
59963
59949
|
* @example `const my_array = new ( UintArrayForCount(x) )(length);`
|
|
59964
59950
|
* @param {number} max_value maximum value to be contained in the array
|
|
@@ -60108,62 +60094,62 @@ class HashMap {
|
|
|
60108
60094
|
* number of bins is always power or two
|
|
60109
60095
|
* @type {Uint32Array}
|
|
60110
60096
|
*/
|
|
60111
|
-
|
|
60097
|
+
__bins = EMPTY_BINS;
|
|
60112
60098
|
|
|
60113
60099
|
/**
|
|
60114
60100
|
* Note that dead entries are marked as such with a special reserved hash values, so records can be reused for new entries
|
|
60115
60101
|
* @type {Array<HashMapEntry<K,V>>}
|
|
60116
60102
|
*/
|
|
60117
|
-
|
|
60103
|
+
__entries = new Array(0);
|
|
60118
60104
|
|
|
60119
60105
|
/**
|
|
60120
60106
|
* Pointer to the end of allocated entries segment
|
|
60121
60107
|
* @type {number}
|
|
60122
60108
|
*/
|
|
60123
|
-
|
|
60109
|
+
__entries_bound = 0;
|
|
60124
60110
|
|
|
60125
60111
|
/**
|
|
60126
60112
|
*
|
|
60127
60113
|
* @type {number}
|
|
60128
60114
|
*/
|
|
60129
|
-
|
|
60115
|
+
__entries_start = 0;
|
|
60130
60116
|
|
|
60131
60117
|
/**
|
|
60132
60118
|
* number of records in the map
|
|
60133
60119
|
* @type {number}
|
|
60134
60120
|
*/
|
|
60135
|
-
|
|
60121
|
+
__size = 0;
|
|
60136
60122
|
|
|
60137
|
-
|
|
60123
|
+
__bin_count = 0;
|
|
60138
60124
|
|
|
60139
60125
|
/**
|
|
60140
60126
|
* Always exactly half of the number of bins
|
|
60141
60127
|
* @type {number}
|
|
60142
60128
|
*/
|
|
60143
|
-
|
|
60129
|
+
__entries_allocated_count = 0;
|
|
60144
60130
|
|
|
60145
|
-
|
|
60131
|
+
__bin_count_power_of_two = 0;
|
|
60146
60132
|
|
|
60147
|
-
|
|
60133
|
+
__entries_count_power_of_two = 0;
|
|
60148
60134
|
|
|
60149
60135
|
/**
|
|
60150
60136
|
* Mask used to map from hash to a bin index
|
|
60151
60137
|
* @type {number}
|
|
60152
60138
|
*/
|
|
60153
|
-
|
|
60139
|
+
__bin_count_mask = 0;
|
|
60154
60140
|
|
|
60155
60141
|
/**
|
|
60156
60142
|
* How full the table can get before number of buckets is increased
|
|
60157
60143
|
* @type {number}
|
|
60158
60144
|
* @private
|
|
60159
60145
|
*/
|
|
60160
|
-
|
|
60146
|
+
__load_factor = DEFAULT_LOAD_FACTOR;
|
|
60161
60147
|
|
|
60162
60148
|
/**
|
|
60163
60149
|
* Used to track modifications to prevent concurrent changes during iteration
|
|
60164
60150
|
* @type {number}
|
|
60165
60151
|
*/
|
|
60166
|
-
|
|
60152
|
+
__version = 0;
|
|
60167
60153
|
|
|
60168
60154
|
/**
|
|
60169
60155
|
* @template K, V
|
|
@@ -60194,13 +60180,13 @@ class HashMap {
|
|
|
60194
60180
|
*/
|
|
60195
60181
|
this.keyEqualityFunction = keyEqualityFunction;
|
|
60196
60182
|
|
|
60197
|
-
this
|
|
60183
|
+
this.__load_factor = loadFactor;
|
|
60198
60184
|
|
|
60199
60185
|
this.#setBinCount(ceilPowerOfTwo(capacity));
|
|
60200
60186
|
}
|
|
60201
60187
|
|
|
60202
60188
|
get size() {
|
|
60203
|
-
return this
|
|
60189
|
+
return this.__size;
|
|
60204
60190
|
}
|
|
60205
60191
|
|
|
60206
60192
|
/**
|
|
@@ -60208,7 +60194,7 @@ class HashMap {
|
|
|
60208
60194
|
* @returns {number}
|
|
60209
60195
|
*/
|
|
60210
60196
|
getCurrentLoad() {
|
|
60211
|
-
return this
|
|
60197
|
+
return this.__size / this.__bin_count;
|
|
60212
60198
|
}
|
|
60213
60199
|
|
|
60214
60200
|
/**
|
|
@@ -60217,33 +60203,33 @@ class HashMap {
|
|
|
60217
60203
|
*/
|
|
60218
60204
|
#setBinCount(count) {
|
|
60219
60205
|
|
|
60220
|
-
if (count < this
|
|
60221
|
-
throw new Error(`count must be at least equal to must of records in the map (=${this
|
|
60206
|
+
if (count < this.__size) {
|
|
60207
|
+
throw new Error(`count must be at least equal to must of records in the map (=${this.__size}), instead was ${count}`);
|
|
60222
60208
|
}
|
|
60223
60209
|
|
|
60224
60210
|
|
|
60225
|
-
this
|
|
60226
|
-
this
|
|
60211
|
+
this.__entries_count_power_of_two = ctz32(count);
|
|
60212
|
+
this.__bin_count_power_of_two = this.__entries_count_power_of_two + 1;
|
|
60227
60213
|
|
|
60228
|
-
this
|
|
60229
|
-
this
|
|
60214
|
+
this.__bin_count = 2 ** this.__bin_count_power_of_two;
|
|
60215
|
+
this.__bin_count_mask = this.__bin_count - 1;
|
|
60230
60216
|
|
|
60231
|
-
const old_entry_allocation_count = this
|
|
60217
|
+
const old_entry_allocation_count = this.__entries_allocated_count;
|
|
60232
60218
|
|
|
60233
|
-
this
|
|
60219
|
+
this.__entries_allocated_count = 2 ** this.__entries_count_power_of_two;
|
|
60234
60220
|
|
|
60235
|
-
const BinsArray = UintArrayForCount(this
|
|
60221
|
+
const BinsArray = UintArrayForCount(this.__entries_allocated_count + ENTRY_BASE);
|
|
60236
60222
|
|
|
60237
|
-
this
|
|
60223
|
+
this.__bins = new BinsArray(this.__bin_count);
|
|
60238
60224
|
|
|
60239
|
-
const new_entries = new Array(this
|
|
60240
|
-
const old_entries = this
|
|
60225
|
+
const new_entries = new Array(this.__entries_allocated_count);
|
|
60226
|
+
const old_entries = this.__entries;
|
|
60241
60227
|
|
|
60242
|
-
this
|
|
60228
|
+
this.__entries = new_entries;
|
|
60243
60229
|
|
|
60244
|
-
array_copy(old_entries, 0, new_entries, 0, min2(old_entry_allocation_count, this
|
|
60230
|
+
array_copy(old_entries, 0, new_entries, 0, min2(old_entry_allocation_count, this.__entries_allocated_count));
|
|
60245
60231
|
|
|
60246
|
-
if (this
|
|
60232
|
+
if (this.__size > 0) {
|
|
60247
60233
|
// re-hash
|
|
60248
60234
|
this.rebuild();
|
|
60249
60235
|
}
|
|
@@ -60255,7 +60241,7 @@ class HashMap {
|
|
|
60255
60241
|
* @returns {number}
|
|
60256
60242
|
* @private
|
|
60257
60243
|
*/
|
|
60258
|
-
|
|
60244
|
+
compute_bin_index(hash) {
|
|
60259
60245
|
|
|
60260
60246
|
// mix the input hash to minimize potential impact of poor hash function spread
|
|
60261
60247
|
const mixed_hash = (hash >>> 16) ^ hash;
|
|
@@ -60263,7 +60249,7 @@ class HashMap {
|
|
|
60263
60249
|
// force index to unsigned integer
|
|
60264
60250
|
const index = mixed_hash >>> 0;
|
|
60265
60251
|
|
|
60266
|
-
return index & this
|
|
60252
|
+
return index & this.__bin_count_mask;
|
|
60267
60253
|
}
|
|
60268
60254
|
|
|
60269
60255
|
/**
|
|
@@ -60309,15 +60295,15 @@ class HashMap {
|
|
|
60309
60295
|
*/
|
|
60310
60296
|
#allocate_entry(k, v, hash) {
|
|
60311
60297
|
|
|
60312
|
-
const i = this
|
|
60298
|
+
const i = this.__entries_bound;
|
|
60313
60299
|
|
|
60314
|
-
this
|
|
60300
|
+
this.__entries_bound++;
|
|
60315
60301
|
|
|
60316
|
-
if (this
|
|
60302
|
+
if (this.__entries[i] !== undefined) {
|
|
60317
60303
|
|
|
60318
60304
|
// entry exists, let's reuse it
|
|
60319
60305
|
|
|
60320
|
-
const entry = this
|
|
60306
|
+
const entry = this.__entries[i];
|
|
60321
60307
|
|
|
60322
60308
|
entry.hash = hash;
|
|
60323
60309
|
entry.key = k;
|
|
@@ -60327,7 +60313,7 @@ class HashMap {
|
|
|
60327
60313
|
|
|
60328
60314
|
// entry slot is empty
|
|
60329
60315
|
|
|
60330
|
-
this
|
|
60316
|
+
this.__entries[i] = new HashMapEntry(k, v, hash);
|
|
60331
60317
|
|
|
60332
60318
|
}
|
|
60333
60319
|
|
|
@@ -60348,11 +60334,11 @@ class HashMap {
|
|
|
60348
60334
|
}
|
|
60349
60335
|
|
|
60350
60336
|
#rebuild_if_necessary() {
|
|
60351
|
-
if (this
|
|
60337
|
+
if (this.__entries_bound !== this.__entries_allocated_count) {
|
|
60352
60338
|
return;
|
|
60353
60339
|
}
|
|
60354
60340
|
|
|
60355
|
-
if (this
|
|
60341
|
+
if (this.__size === this.__entries_allocated_count) {
|
|
60356
60342
|
// used up all allocated entries
|
|
60357
60343
|
// bin count must always be larger than end of the entries table
|
|
60358
60344
|
this.#grow();
|
|
@@ -60371,18 +60357,18 @@ class HashMap {
|
|
|
60371
60357
|
this.#rebuild_if_necessary();
|
|
60372
60358
|
|
|
60373
60359
|
const raw_hash = this.#build_key_hash(key);
|
|
60374
|
-
let bin_index = this
|
|
60360
|
+
let bin_index = this.compute_bin_index(raw_hash);
|
|
60375
60361
|
|
|
60376
60362
|
let first_deleted_bin_index = UNDEFINED_BIN_INDEX;
|
|
60377
60363
|
|
|
60378
60364
|
for (; ;) {
|
|
60379
|
-
const bin = this
|
|
60365
|
+
const bin = this.__bins[bin_index];
|
|
60380
60366
|
|
|
60381
60367
|
if (bin > BIN_RESERVED_VALUE_DELETED) {
|
|
60382
60368
|
// bin is occupied
|
|
60383
60369
|
|
|
60384
60370
|
// check if it's the entry that we're looking for
|
|
60385
|
-
const entry = this
|
|
60371
|
+
const entry = this.__entries[bin - ENTRY_BASE];
|
|
60386
60372
|
|
|
60387
60373
|
if (this.#entry_equality_check(entry, raw_hash, key)) {
|
|
60388
60374
|
// found the right entry
|
|
@@ -60402,7 +60388,7 @@ class HashMap {
|
|
|
60402
60388
|
|
|
60403
60389
|
const bin_value = entry_index + ENTRY_BASE;
|
|
60404
60390
|
|
|
60405
|
-
this
|
|
60391
|
+
this.__bins[bin_index] = bin_value;
|
|
60406
60392
|
|
|
60407
60393
|
break;
|
|
60408
60394
|
|
|
@@ -60413,19 +60399,19 @@ class HashMap {
|
|
|
60413
60399
|
}
|
|
60414
60400
|
|
|
60415
60401
|
// perform secondary hashing
|
|
60416
|
-
bin_index = generate_next_linear_congruential_index(bin_index, this
|
|
60402
|
+
bin_index = generate_next_linear_congruential_index(bin_index, this.__bin_count_mask);
|
|
60417
60403
|
|
|
60418
60404
|
}
|
|
60419
60405
|
|
|
60420
|
-
const old_size = this
|
|
60406
|
+
const old_size = this.__size;
|
|
60421
60407
|
const new_size = old_size + 1;
|
|
60422
|
-
this
|
|
60408
|
+
this.__size = new_size;
|
|
60423
60409
|
|
|
60424
60410
|
// compute actual current load
|
|
60425
|
-
const bucket_count = this
|
|
60411
|
+
const bucket_count = this.__bin_count;
|
|
60426
60412
|
const load = new_size / bucket_count;
|
|
60427
60413
|
|
|
60428
|
-
if (load > this
|
|
60414
|
+
if (load > this.__load_factor) {
|
|
60429
60415
|
// current load is too high, increase table size
|
|
60430
60416
|
this.#grow();
|
|
60431
60417
|
}
|
|
@@ -60439,16 +60425,16 @@ class HashMap {
|
|
|
60439
60425
|
get(key) {
|
|
60440
60426
|
const raw_hash = this.#build_key_hash(key);
|
|
60441
60427
|
|
|
60442
|
-
let bin_index = this
|
|
60428
|
+
let bin_index = this.compute_bin_index(raw_hash);
|
|
60443
60429
|
|
|
60444
60430
|
for (; ;) {
|
|
60445
|
-
const bin = this
|
|
60431
|
+
const bin = this.__bins[bin_index];
|
|
60446
60432
|
|
|
60447
60433
|
if (bin > BIN_RESERVED_VALUE_DELETED) {
|
|
60448
60434
|
// bin is occupied
|
|
60449
60435
|
|
|
60450
60436
|
// check if the entry is what we're looking for
|
|
60451
|
-
const entry = this
|
|
60437
|
+
const entry = this.__entries[bin - ENTRY_BASE];
|
|
60452
60438
|
|
|
60453
60439
|
if (this.#entry_equality_check(entry, raw_hash, key)) {
|
|
60454
60440
|
// found the right entry
|
|
@@ -60461,7 +60447,7 @@ class HashMap {
|
|
|
60461
60447
|
}
|
|
60462
60448
|
|
|
60463
60449
|
// perform secondary hashing
|
|
60464
|
-
bin_index = generate_next_linear_congruential_index(bin_index, this
|
|
60450
|
+
bin_index = generate_next_linear_congruential_index(bin_index, this.__bin_count_mask);
|
|
60465
60451
|
|
|
60466
60452
|
}
|
|
60467
60453
|
|
|
@@ -60510,22 +60496,23 @@ class HashMap {
|
|
|
60510
60496
|
}
|
|
60511
60497
|
|
|
60512
60498
|
/**
|
|
60513
|
-
*
|
|
60514
|
-
* @param {number} bin
|
|
60499
|
+
* Update the entries start of table TAB after removing an entry with index N in the array entries.
|
|
60500
|
+
* @param {number} bin index of deleted entry
|
|
60515
60501
|
*/
|
|
60516
60502
|
#update_range_for_deleted(bin) {
|
|
60517
|
-
if (this
|
|
60518
|
-
|
|
60519
|
-
|
|
60520
|
-
|
|
60521
|
-
const entries = this.#entries;
|
|
60503
|
+
if (this.__entries_start !== bin) {
|
|
60504
|
+
return;
|
|
60505
|
+
}
|
|
60522
60506
|
|
|
60523
|
-
|
|
60524
|
-
|
|
60525
|
-
|
|
60507
|
+
let start = bin + 1;
|
|
60508
|
+
let bound = this.__entries_bound;
|
|
60509
|
+
const entries = this.__entries;
|
|
60526
60510
|
|
|
60527
|
-
|
|
60511
|
+
while (start < bound && entries[start].hash === RESERVED_HASH) {
|
|
60512
|
+
start++;
|
|
60528
60513
|
}
|
|
60514
|
+
|
|
60515
|
+
this.__entries_start = start;
|
|
60529
60516
|
}
|
|
60530
60517
|
|
|
60531
60518
|
/**
|
|
@@ -60536,10 +60523,10 @@ class HashMap {
|
|
|
60536
60523
|
delete(key) {
|
|
60537
60524
|
|
|
60538
60525
|
const raw_hash = this.#build_key_hash(key);
|
|
60539
|
-
let bin_index = this
|
|
60526
|
+
let bin_index = this.compute_bin_index(raw_hash);
|
|
60540
60527
|
|
|
60541
|
-
const bins = this
|
|
60542
|
-
const entries = this
|
|
60528
|
+
const bins = this.__bins;
|
|
60529
|
+
const entries = this.__entries;
|
|
60543
60530
|
|
|
60544
60531
|
for (; ;) {
|
|
60545
60532
|
const bin = bins[bin_index];
|
|
@@ -60560,7 +60547,7 @@ class HashMap {
|
|
|
60560
60547
|
// mark slot as removed
|
|
60561
60548
|
bins[bin_index] = BIN_RESERVED_VALUE_DELETED;
|
|
60562
60549
|
|
|
60563
|
-
this
|
|
60550
|
+
this.__size--;
|
|
60564
60551
|
|
|
60565
60552
|
this.#update_range_for_deleted(entry_index);
|
|
60566
60553
|
|
|
@@ -60573,7 +60560,7 @@ class HashMap {
|
|
|
60573
60560
|
}
|
|
60574
60561
|
|
|
60575
60562
|
// perform secondary hashing
|
|
60576
|
-
bin_index = generate_next_linear_congruential_index(bin_index, this
|
|
60563
|
+
bin_index = generate_next_linear_congruential_index(bin_index, this.__bin_count_mask);
|
|
60577
60564
|
|
|
60578
60565
|
}
|
|
60579
60566
|
}
|
|
@@ -60587,9 +60574,9 @@ class HashMap {
|
|
|
60587
60574
|
verifyHashes(callback, thisArg) {
|
|
60588
60575
|
let all_hashes_valid = true;
|
|
60589
60576
|
|
|
60590
|
-
const count = this
|
|
60577
|
+
const count = this.__bin_count;
|
|
60591
60578
|
for (let j = 0; j < count; j++) {
|
|
60592
|
-
const bin = this
|
|
60579
|
+
const bin = this.__bins[j];
|
|
60593
60580
|
|
|
60594
60581
|
if (bin <= BIN_RESERVED_VALUE_DELETED) {
|
|
60595
60582
|
// unoccupied
|
|
@@ -60599,7 +60586,7 @@ class HashMap {
|
|
|
60599
60586
|
/**
|
|
60600
60587
|
* @type {HashMapEntry<K,V>}
|
|
60601
60588
|
*/
|
|
60602
|
-
const entry = this
|
|
60589
|
+
const entry = this.__entries[bin - ENTRY_BASE];
|
|
60603
60590
|
|
|
60604
60591
|
//check hash
|
|
60605
60592
|
const raw_hash = this.#build_key_hash(entry.key);
|
|
@@ -60616,7 +60603,7 @@ class HashMap {
|
|
|
60616
60603
|
}
|
|
60617
60604
|
|
|
60618
60605
|
#grow() {
|
|
60619
|
-
this.#setBinCount(this
|
|
60606
|
+
this.#setBinCount(this.__entries_allocated_count * 2);
|
|
60620
60607
|
}
|
|
60621
60608
|
|
|
60622
60609
|
|
|
@@ -60624,17 +60611,17 @@ class HashMap {
|
|
|
60624
60611
|
* Rebuild table, useful for when table is resized
|
|
60625
60612
|
*/
|
|
60626
60613
|
rebuild() {
|
|
60627
|
-
const entries_bound = this
|
|
60628
|
-
const entries = this
|
|
60614
|
+
const entries_bound = this.__entries_bound;
|
|
60615
|
+
const entries = this.__entries;
|
|
60629
60616
|
|
|
60630
60617
|
// reset all bins
|
|
60631
|
-
const bins = this
|
|
60618
|
+
const bins = this.__bins;
|
|
60632
60619
|
bins.fill(BIN_RESERVED_VALUE_EMPTY);
|
|
60633
60620
|
|
|
60634
60621
|
let written_entries = 0;
|
|
60635
60622
|
|
|
60636
60623
|
for (
|
|
60637
|
-
let existing_entry_index = this
|
|
60624
|
+
let existing_entry_index = this.__entries_start;
|
|
60638
60625
|
existing_entry_index < entries_bound;
|
|
60639
60626
|
existing_entry_index++
|
|
60640
60627
|
) {
|
|
@@ -60652,11 +60639,13 @@ class HashMap {
|
|
|
60652
60639
|
|
|
60653
60640
|
if (new_index !== existing_entry_index) {
|
|
60654
60641
|
// move entries to the new position, compacting holes
|
|
60655
|
-
|
|
60642
|
+
|
|
60643
|
+
entries[new_index] = entries[existing_entry_index];
|
|
60656
60644
|
}
|
|
60657
60645
|
|
|
60658
|
-
let bin_index = this
|
|
60646
|
+
let bin_index = this.compute_bin_index(hash);
|
|
60659
60647
|
|
|
60648
|
+
// search for place for the entry
|
|
60660
60649
|
for (; ;) {
|
|
60661
60650
|
const bin = bins[bin_index];
|
|
60662
60651
|
|
|
@@ -60667,20 +60656,20 @@ class HashMap {
|
|
|
60667
60656
|
}
|
|
60668
60657
|
|
|
60669
60658
|
// perform secondary hashing
|
|
60670
|
-
bin_index = generate_next_linear_congruential_index(bin_index, this
|
|
60659
|
+
bin_index = generate_next_linear_congruential_index(bin_index, this.__bin_count_mask);
|
|
60671
60660
|
|
|
60672
60661
|
}
|
|
60673
60662
|
}
|
|
60674
60663
|
|
|
60675
|
-
this
|
|
60676
|
-
this
|
|
60677
|
-
this
|
|
60664
|
+
this.__entries_start = 0;
|
|
60665
|
+
this.__entries_bound = this.__size;
|
|
60666
|
+
this.__version++;
|
|
60678
60667
|
}
|
|
60679
60668
|
|
|
60680
60669
|
#count_live_entities() {
|
|
60681
60670
|
let count = 0;
|
|
60682
|
-
for (let i = this
|
|
60683
|
-
const entry = this
|
|
60671
|
+
for (let i = this.__entries_start; i < this.__entries_bound; i++) {
|
|
60672
|
+
const entry = this.__entries[i];
|
|
60684
60673
|
|
|
60685
60674
|
if (entry.hash !== RESERVED_HASH) {
|
|
60686
60675
|
count++;
|
|
@@ -60692,10 +60681,10 @@ class HashMap {
|
|
|
60692
60681
|
|
|
60693
60682
|
forEach(callback, thisArg) {
|
|
60694
60683
|
|
|
60695
|
-
const count = this
|
|
60696
|
-
const entries = this
|
|
60697
|
-
const bins = this
|
|
60698
|
-
this
|
|
60684
|
+
const count = this.__bin_count;
|
|
60685
|
+
const entries = this.__entries;
|
|
60686
|
+
const bins = this.__bins;
|
|
60687
|
+
this.__version;
|
|
60699
60688
|
|
|
60700
60689
|
for (let j = 0; j < count; j++) {
|
|
60701
60690
|
|
|
@@ -60731,8 +60720,8 @@ class HashMap {
|
|
|
60731
60720
|
clear() {
|
|
60732
60721
|
|
|
60733
60722
|
// clear out all
|
|
60734
|
-
const bins = this
|
|
60735
|
-
const count = this
|
|
60723
|
+
const bins = this.__bins;
|
|
60724
|
+
const count = this.__bin_count;
|
|
60736
60725
|
|
|
60737
60726
|
for (let i = 0; i < count; i++) {
|
|
60738
60727
|
const bin = bins[i];
|
|
@@ -60743,7 +60732,7 @@ class HashMap {
|
|
|
60743
60732
|
// occupied, move to deleted
|
|
60744
60733
|
const entry_index = bin - ENTRY_BASE;
|
|
60745
60734
|
|
|
60746
|
-
this.#deallocate(this
|
|
60735
|
+
this.#deallocate(this.__entries[entry_index]);
|
|
60747
60736
|
}
|
|
60748
60737
|
|
|
60749
60738
|
// mark as empty
|
|
@@ -60753,20 +60742,20 @@ class HashMap {
|
|
|
60753
60742
|
|
|
60754
60743
|
}
|
|
60755
60744
|
|
|
60756
|
-
this
|
|
60745
|
+
this.__size = 0;
|
|
60757
60746
|
|
|
60758
|
-
this
|
|
60759
|
-
this
|
|
60747
|
+
this.__entries_start = 0;
|
|
60748
|
+
this.__entries_bound = 0;
|
|
60760
60749
|
}
|
|
60761
60750
|
|
|
60762
60751
|
* [Symbol.iterator]() {
|
|
60763
60752
|
|
|
60764
|
-
const count = this
|
|
60753
|
+
const count = this.__bin_count;
|
|
60765
60754
|
|
|
60766
|
-
const bins = this
|
|
60767
|
-
const entries = this
|
|
60755
|
+
const bins = this.__bins;
|
|
60756
|
+
const entries = this.__entries;
|
|
60768
60757
|
|
|
60769
|
-
this
|
|
60758
|
+
this.__version;
|
|
60770
60759
|
|
|
60771
60760
|
for (let j = 0; j < count; j++) {
|
|
60772
60761
|
|
|
@@ -106545,6 +106534,20 @@ function computeBinaryDataTypeByPrecision(type, precision) {
|
|
|
106545
106534
|
throw new Error(`Unsupported numeric type(=${type}) and precision(=${precision}) combination`);
|
|
106546
106535
|
}
|
|
106547
106536
|
|
|
106537
|
+
/**
|
|
106538
|
+
* @template T
|
|
106539
|
+
* @param {T[]} array
|
|
106540
|
+
* @param {number} index0
|
|
106541
|
+
* @param {number} index1
|
|
106542
|
+
*/
|
|
106543
|
+
function array_swap_one(array, index0, index1) {
|
|
106544
|
+
|
|
106545
|
+
const t = array[index0];
|
|
106546
|
+
|
|
106547
|
+
array[index0] = array[index1];
|
|
106548
|
+
array[index1] = t;
|
|
106549
|
+
}
|
|
106550
|
+
|
|
106548
106551
|
const stack$1 = [];
|
|
106549
106552
|
|
|
106550
106553
|
/**
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;GAYG;AACH,uFAIC;AA8FD;;;;;;;GAOG;AACH;IA+DI;;;;;;OAMG;IACH,4FALuB,MAAM,EAsC5B;IAtGD;;;;OAIG;IACH,QAFU,WAAW,CAED;IAEpB;;;OAGG;IACH,WAFU,MAAM,aAAa,CAAC,EAAC,CAAC,CAAC,CAAC,CAET;IAEzB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,QAFU,MAAM,CAEL;IAEX,oBAAgB;IAEhB;;;OAGG;IACH,2BAFU,MAAM,CAEc;IAE9B,iCAA6B;IAE7B,qCAAiC;IAEjC;;;OAGG;IACH,kBAFU,MAAM,CAEK;IAErB;;;;OAIG;IACH,sBAAoC;IAEpC;;;OAGG;IACH,WAFU,MAAM,CAEF;IAwBV;;;;;OAKG;IACH,iCAAsC;IACtC;;;;;OAKG;IACH,qCAA8C;IAOlD,mBAEC;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA2CD;;;;;OAKG;IACH,0BAUC;IAsGD;;;;OAIG;IACH,SAHW,CAAC,SACD,CAAC,QA0EX;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,CAAC,GAAC,SAAS,CA+BvB;IAED;;;;;;;;OAQG;IACH,kBALW,CAAC,kBACQ,CAAC,KAAE,CAAC,0BAEZ,CAAC,CAgBZ;IAED;;;;;OAKG;IACH,cAJW,CAAC,SACD,CAAC,GACA,CAAC,CAYZ;IAwBD;;;;OAIG;IACH,YAHW,CAAC,GACC,OAAO,CA+CnB;IAED;;;;;OAKG;IACH,4CAFa,OAAO,CA+BnB;IAOD;;OAEG;IACH,gBAwDC;IAmBD,2CA0BC;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,OAAO,CAInB;IAED;;OAEG;IACH,cA6BC;IA+BD;;;OAGG;IACH,UAFa,SAAS,CAAC,CAAC,CAOvB;IAED;;;OAGG;IACH,QAFa,SAAS,CAAC,CAAC,CAMvB;IAhDD,yDA2BC;;CAsBJ;AA/0BD;;GAEG;AACH;IACI;;;;;OAKG;IACH,iBAJW,CAAC,SACD,CAAC,QACD,MAAM,EAsBhB;IAlBG;;;OAGG;IACH,KAFU,CAAC,CAEG;IAEd;;;OAGG;IACH,OAFU,CAAC,CAEO;IAElB;;;OAGG;IACH,MAFU,MAAM,CAEA;CAGvB"}
|