Avoid cloning ExpnData to access Span edition
ExpnData is a fairly hefty structure to clone; cloning it may not be cheap. In some cases this may get optimized out, but it's not clear that will always be the case. Try to avoid that cost.
This commit is contained in:
parent
81053b912f
commit
7d373c9c11
1 changed files with 1 additions and 1 deletions
|
@ -644,7 +644,7 @@ impl SyntaxContext {
|
|||
}
|
||||
|
||||
pub fn edition(self) -> Edition {
|
||||
self.outer_expn_data().edition
|
||||
HygieneData::with(|data| data.expn_data(data.outer_expn(self)).edition)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue