mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Use drain_sorted
This commit is contained in:
parent
efe2eb046c
commit
9d2ea10090
@ -110,7 +110,10 @@ impl Sentiments {
|
||||
.collect::<BinaryHeap<_>>();
|
||||
|
||||
// Remove the superfluous sentiments
|
||||
for (_, tgt) in sentiments.drain().take(self.map.len() - max_sentiments) {
|
||||
for (_, tgt) in sentiments
|
||||
.drain_sorted()
|
||||
.take(self.map.len() - max_sentiments)
|
||||
{
|
||||
self.map.remove(&tgt);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,8 @@
|
||||
trait_alias,
|
||||
trait_upcasting,
|
||||
control_flow_enum,
|
||||
let_chains
|
||||
let_chains,
|
||||
binary_heap_drain_sorted
|
||||
)]
|
||||
|
||||
pub mod ai;
|
||||
|
Loading…
Reference in New Issue
Block a user