Simplify BTreeSet construction

Co-authored-by: Ivan Tham <pickfire@riseup.net>
pull/969/head
Triton171 3 years ago committed by Blaž Hrastnik
parent eb8745db09
commit 7a0c4322ea

@ -147,11 +147,7 @@ impl KeyTrieNode {
Some(pos) => { Some(pos) => {
body[pos].1.insert(key); body[pos].1.insert(key);
} }
None => { None => body.push((desc, BTreeSet::from([key]))),
let mut keys = BTreeSet::new();
keys.insert(key);
body.push((desc, keys));
}
} }
} }
body.sort_unstable_by_key(|(_, keys)| { body.sort_unstable_by_key(|(_, keys)| {

Loading…
Cancel
Save