From fd3d93a93f13054dcc414e608e8708c806c222e7 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 21 Nov 2026 00:33:01 +0100 Subject: [PATCH] refactor: walk slot keys from slot_lookup_keys --- scripts/resolve/slot.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/resolve/slot.py b/scripts/resolve/slot.py index d445cdd15..27408fd46 100644 --- a/scripts/resolve/slot.py +++ b/scripts/resolve/slot.py @@ -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(