@atlaspack/graph 3.5.7-unified-e330ff3d9.0 → 3.5.7-unified-f92fba5b6.0
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/lib/AdjacencyList.js +2 -1
- package/lib/BitSet.js +11 -4
- package/lib/Graph.js +3 -2
- package/package.json +4 -4
package/lib/AdjacencyList.js
CHANGED
|
@@ -1359,7 +1359,8 @@ function link(from, to, type, edges, nodes, unloadFactor = DEFAULT_PARAMS.unload
|
|
|
1359
1359
|
// Since the space occupied by deleted edges isn't reclaimed,
|
|
1360
1360
|
// we include them in our count to avoid overflowing the `edges` array.
|
|
1361
1361
|
let deletes = edges.deletes;
|
|
1362
|
-
|
|
1362
|
+
let total = count + deletes;
|
|
1363
|
+
if (edges.getLoad(total) >= 1) {
|
|
1363
1364
|
if (edges.getLoad(deletes) >= unloadFactor && edges.getLoad(count) < unloadFactor) {
|
|
1364
1365
|
// If we have a significant number of deletes, reclaim the space.
|
|
1365
1366
|
return LinkResult.TooManyDeletes;
|
package/lib/BitSet.js
CHANGED
|
@@ -9,7 +9,8 @@ function ctz32(n) {
|
|
|
9
9
|
if (n === 0) {
|
|
10
10
|
return 32;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
let reversed = n & -n;
|
|
13
|
+
return 31 - Math.clz32(reversed);
|
|
13
14
|
}
|
|
14
15
|
class BitSet {
|
|
15
16
|
constructor(maxBits) {
|
|
@@ -34,13 +35,19 @@ class BitSet {
|
|
|
34
35
|
return this.bits.length * 32;
|
|
35
36
|
}
|
|
36
37
|
add(bit) {
|
|
37
|
-
|
|
38
|
+
let i = bit >>> 5;
|
|
39
|
+
let b = bit & 31;
|
|
40
|
+
this.bits[i] |= 1 << b;
|
|
38
41
|
}
|
|
39
42
|
delete(bit) {
|
|
40
|
-
|
|
43
|
+
let i = bit >>> 5;
|
|
44
|
+
let b = bit & 31;
|
|
45
|
+
this.bits[i] &= ~(1 << b);
|
|
41
46
|
}
|
|
42
47
|
has(bit) {
|
|
43
|
-
|
|
48
|
+
let i = bit >>> 5;
|
|
49
|
+
let b = bit & 31;
|
|
50
|
+
return Boolean(this.bits[i] & 1 << b);
|
|
44
51
|
}
|
|
45
52
|
empty() {
|
|
46
53
|
for (let k = 0; k < this.bits.length; k++) {
|
package/lib/Graph.js
CHANGED
|
@@ -324,6 +324,7 @@ class Graph {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
this._visited = visited;
|
|
327
|
+
return;
|
|
327
328
|
}
|
|
328
329
|
|
|
329
330
|
/**
|
|
@@ -506,7 +507,7 @@ class Graph {
|
|
|
506
507
|
exports.default = Graph;
|
|
507
508
|
function mapVisitor(filter, visit) {
|
|
508
509
|
function makeEnter(visit) {
|
|
509
|
-
return function (nodeId, context, actions) {
|
|
510
|
+
return function mappedEnter(nodeId, context, actions) {
|
|
510
511
|
let value = filter(nodeId, actions);
|
|
511
512
|
if (value != null) {
|
|
512
513
|
return visit(value, context, actions);
|
|
@@ -521,7 +522,7 @@ function mapVisitor(filter, visit) {
|
|
|
521
522
|
mapped.enter = makeEnter(visit.enter);
|
|
522
523
|
}
|
|
523
524
|
if (visit.exit != null) {
|
|
524
|
-
mapped.exit = function (nodeId, context, actions) {
|
|
525
|
+
mapped.exit = function mappedExit(nodeId, context, actions) {
|
|
525
526
|
let exit = visit.exit;
|
|
526
527
|
if (!exit) {
|
|
527
528
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/graph",
|
|
3
|
-
"version": "3.5.7-unified-
|
|
3
|
+
"version": "3.5.7-unified-f92fba5b6.0",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
5
|
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"benchmark": "node ./benchmark/BitSet.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@atlaspack/feature-flags": "2.18.5-unified-
|
|
22
|
+
"@atlaspack/feature-flags": "2.18.5-unified-f92fba5b6.0",
|
|
23
23
|
"nullthrows": "^1.1.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@atlaspack/babel-register": "2.14.2-unified-
|
|
26
|
+
"@atlaspack/babel-register": "2.14.2-unified-f92fba5b6.0",
|
|
27
27
|
"benny": "^3.7.1"
|
|
28
28
|
},
|
|
29
29
|
"type": "commonjs",
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "f92fba5b6216e1d94cbd23f3a5d61f7188d49199"
|
|
31
31
|
}
|