Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64653
Saves shared_ptr refcount inc/dec in SourceRange.
ghstack-source-id:
137608457
Test Plan: Profiled startup of framework overheads benchmark from high_per_models; self time spent in next() is way down.
Reviewed By: dhruvbird
Differential Revision:
D30739240
fbshipit-source-id:
ac455678c9d46e657b111d3788d4369983028674
Token next() {
if (next_tokens.size() == 0)
reportError("Lexer invariant violated: empty token queue");
- Token r = next_tokens.front();
+ Token r = std::move(next_tokens.front());
next_tokens.erase(next_tokens.begin());
if (next_tokens.size() == 0) {
lex();