Rollup merge of #50818 - nnethercote:faster-normalize, r=nikomatsakis
Speed up `opt_normalize_projection_type` `opt_normalize_projection_type` is hot in the serde and futures benchmarks in rustc-perf. These two patches speed up the execution of most runs for them by 2--4%.
This commit is contained in:
commit
54df1bf200
6 changed files with 128 additions and 88 deletions
|
|
@ -67,6 +67,12 @@ impl<K, V> SnapshotMap<K, V>
|
|||
}
|
||||
}
|
||||
|
||||
pub fn insert_noop(&mut self) {
|
||||
if !self.undo_log.is_empty() {
|
||||
self.undo_log.push(UndoLog::Noop);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove(&mut self, key: K) -> bool {
|
||||
match self.map.remove(&key) {
|
||||
Some(old_value) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue