Skip to content

Commit

Permalink
Merge pull request #10394 from timvandermeij/primitives-optimization
Browse files Browse the repository at this point in the history
Optimize the `Ref` class in `src/core/primitives.js`
  • Loading branch information
timvandermeij authored Dec 30, 2018
2 parents e53877f + aad27ff commit 85363f4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ var Ref = (function RefClosure() {
toString: function Ref_toString() {
// This function is hot, so we make the string as compact as possible.
// |this.gen| is almost always zero, so we treat that case specially.
var str = this.num + 'R';
if (this.gen !== 0) {
str += this.gen;
return `${this.num}R${this.gen}`;
}
return str;
return `${this.num}R`;
},
};

Expand Down

0 comments on commit 85363f4

Please sign in to comment.