Skip to content

Commit 40df922

Browse files
committed
cleanup
1 parent dbb51e1 commit 40df922

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Runtime/src/object-heap.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ export class JSObjectSpace {
2828
this._rcById[id]++;
2929
return id;
3030
}
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;
31+
32+
const newId = this._freeStack.length > 0 ? this._freeStack.pop()! : this._values.length;
3933
this._values[newId] = value;
4034
this._rcById[newId] = 1;
4135
this._valueMap.set(value, newId);

0 commit comments

Comments
 (0)