refactor: drop redundant single-parent fast path in _resolve_one_bottle
lint / lint (push) Failing after 1m50s
test / unit (pull_request) Successful in 36s
test / integration (pull_request) Successful in 18s

_fold_parents with one name returns after the first resolve; the
single-element branch was a verbatim copy of the general path.
This commit is contained in:
2026-06-25 07:27:31 +00:00
committed by didericis
parent 2f3dc57fa9
commit 75755a472f
-12
View File
@@ -81,18 +81,6 @@ def _resolve_one_bottle(
f"defined. Available bottles: {avail}" f"defined. Available bottles: {avail}"
) )
if len(parent_names) == 1:
parent_name = parent_names[0]
parent = _resolve_one_bottle(
parent_name, raws, cache, repos_cache, seen + (name,)
)
merged_repos_raw = _resolve_repos_raw(repos_cache[parent_name], child_raw)
bottle = _merge_bottles(parent, child_raw, merged_repos_raw, name)
cache[name] = bottle
repos_cache[name] = merged_repos_raw
return bottle
# Multiple parents: fold left-to-right into a combined parent.
combined_parent, combined_repos_raw = _fold_parents( combined_parent, combined_repos_raw = _fold_parents(
parent_names, raws, cache, repos_cache, seen + (name,) parent_names, raws, cache, repos_cache, seen + (name,)
) )