refactor: walk slot keys from slot_lookup_keys

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:01:11 +01:00
1 parent 11dac5a641
commit fd3d93a93f
1 file changed
+4 -8
+4 -8
View File
@@ -128,16 +128,12 @@ def slot_lookup_keys(destination: str, name: str) -> list[str]:
def lookup_slot(index: dict[str, dict], destination: str, name: str) -> dict | None:
"""Look a candidate up, trying the destination then its suffixes then name."""
if destination:
entry = index.get(destination)
*paths, bare = slot_lookup_keys(destination, name)
for key in paths:
entry = index.get(key)
if entry:
return entry
parts = destination.split("/")
for i in range(1, len(parts)):
entry = index.get("/".join(parts[i:]))
if entry:
return entry
return index.get(name)
return index.get(bare)
def resolve_slot_drops(