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:
Mark Simulacrum 2018-05-17 13:51:27 -06:00 committed by GitHub
commit 54df1bf200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 128 additions and 88 deletions

View file

@ -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) => {