From 44f16452b6437125a93bc48b872d3e54088ff34a Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 23 Oct 2017 14:24:16 -0700 Subject: [PATCH] Replace manual iteration with retain() --- components/style/custom_properties.rs | 6 +----- 1 file changed, 1 insertion(+), 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()); } }