We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbb51e1 commit 40df922Copy full SHA for 40df922
Runtime/src/object-heap.ts
@@ -28,14 +28,8 @@ export class JSObjectSpace {
28
this._rcById[id]++;
29
return id;
30
}
31
- if (this._freeStack.length > 0) {
32
- const newId = this._freeStack.pop()!;
33
- this._values[newId] = value;
34
- this._rcById[newId] = 1;
35
- this._valueMap.set(value, newId);
36
- return newId;
37
- }
38
- const newId = this._values.length;
+
+ const newId = this._freeStack.length > 0 ? this._freeStack.pop()! : this._values.length;
39
this._values[newId] = value;
40
this._rcById[newId] = 1;
41
this._valueMap.set(value, newId);
0 commit comments