mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace manual iteration with retain()
This commit is contained in:
parent
f61151a726
commit
44f16452b6
1 changed files with 1 additions and 5 deletions
|
@ -168,11 +168,7 @@ where
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.index.retain(|key| !set.contains(key));
|
self.index.retain(|key| !set.contains(key));
|
||||||
// XXX It may be better to use retain when we back to use a
|
self.values.retain(|key, _| !set.contains(key));
|
||||||
// normal hashmap rather than DiagnosticHashMap.
|
|
||||||
for key in set.iter() {
|
|
||||||
self.values.remove(key);
|
|
||||||
}
|
|
||||||
debug_assert_eq!(self.values.len(), self.index.len());
|
debug_assert_eq!(self.values.len(), self.index.len());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue