JS: Change Chunk.p.ref to allow inlining

Not sure why the old code did not get inlined correctly. With this
change `ref` no longer shows up in my profile. (It was the hottest
function before.)
This commit is contained in:
Erik Arvidsson
2015-12-17 17:32:03 -05:00
parent 72cf6d72de
commit 96e80f4878

View File

@@ -16,11 +16,7 @@ export default class Chunk {
}
get ref(): Ref {
if (this._ref) {
return this._ref;
} else {
return this._ref = Ref.fromData(this.data);
}
return this._ref || (this._ref = Ref.fromData(this.data));
}
isEmpty(): boolean {