Avoid re-cloning name when populating ambiguous set (#11401)

This commit is contained in:
Charlie Marsh
2025-02-10 15:26:57 -05:00
committed by GitHub
parent f1221a6676
commit 8c8bed9454
+2 -2
View File
@@ -1693,8 +1693,8 @@ impl TryFrom<LockWire> for Lock {
if ambiguous.contains(&dist.id.name) {
continue;
}
if unambiguous_package_ids.remove(&dist.id.name).is_some() {
ambiguous.insert(dist.id.name.clone());
if let Some(id) = unambiguous_package_ids.remove(&dist.id.name) {
ambiguous.insert(id.name);
continue;
}
unambiguous_package_ids.insert(dist.id.name.clone(), dist.id.clone());