Remove DropNodeKey::kind.

It's not needed, because `next` and `local` fields uniquely identify the
drop. This is a ~2% speed win on the very large program in #134404, and
it's also a tiny bit simpler.
This commit is contained in:
Nicholas Nethercote
2025-05-20 16:39:59 +10:00
parent 283db70ace
commit df09feddfa

View File

@@ -230,7 +230,6 @@ struct DropNode {
struct DropNodeKey {
next: DropIdx,
local: Local,
kind: DropKind,
}
impl Scope {
@@ -291,7 +290,7 @@ impl DropTree {
let drops = &mut self.drops;
*self
.existing_drops_map
.entry(DropNodeKey { next, local: data.local, kind: data.kind })
.entry(DropNodeKey { next, local: data.local })
// Create a new node, and also add its index to the map.
.or_insert_with(|| drops.push(DropNode { data, next }))
}