Refactor HygieneEncodeContext - #162520
Conversation
|
This is missing some high level description. |
So the changes are to 1) reuse the capacity between the loop iterations (#162520 (comment)) and 2) move some map searches under the |
Renamed them back.
There were borrowing problems because hygiene context is contained inside the encoder. @rustbot ready |
| // Consume the current round of syntax contexts. | ||
| // Drop the lock() temporary early. | ||
| // It's fine to iterate over a HashMap, because the serialization of the table | ||
| // that we insert data into doesn't depend on insertion order. |
There was a problem hiding this comment.
Could you keep these comments? They look useful.
| pub fn raw_encode_syntax_context( | ||
| ctxt: SyntaxContext, | ||
| context: &HygieneEncodeContext, | ||
| context: Rc<RefCell<HygieneEncodeContext>>, |
There was a problem hiding this comment.
| context: Rc<RefCell<HygieneEncodeContext>>, | |
| context: &RefCell<HygieneEncodeContext>, |
This doesn't work here due to encode below?
|
✌️ @aerooneqq, you can now approve this pull request! If @petrochenkov told you to " |
|
Reminder, once the PR becomes ready for a review, use |
View all comments
Some refactorings around
HygieneEncodeContextwith minor perf improvements, the most notable thing is thatLocks were removed.First part for #161450.
r? @petrochenkov