aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2017-10-23 14:24:16 -0700
committerManish Goregaokar <manishsmail@gmail.com>2017-10-23 14:24:16 -0700
commit44f16452b6437125a93bc48b872d3e54088ff34a (patch)
tree1bfe317eee84913ec7b5bf533779c94b20dad6ac
parentf61151a726b19c1a325b21c4b879b612450d270d (diff)
downloadservo-44f16452b6437125a93bc48b872d3e54088ff34a.tar.gz
servo-44f16452b6437125a93bc48b872d3e54088ff34a.zip
Replace manual iteration with retain()
-rw-r--r--components/style/custom_properties.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs
index c0a540e5b17..05967a8f922 100644
--- a/components/style/custom_properties.rs
+++ b/components/style/custom_properties.rs
@@ -168,11 +168,7 @@ where
return;
}
self.index.retain(|key| !set.contains(key));
- // XXX It may be better to use retain when we back to use a
- // normal hashmap rather than DiagnosticHashMap.
- for key in set.iter() {
- self.values.remove(key);
- }
+ self.values.retain(|key, _| !set.contains(key));
debug_assert_eq!(self.values.len(), self.index.len());
}
}