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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

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());