App.get_project_refs(): Use a set for deduplication #120

Merged
Jan Lindemann merged 1 commit from jan/feature/20260922-app-get-project-refs-use-a-set-for-deduplication into master 2026-09-22 09:38:20 +02:00 AGit

App.get_project_refs(): Use a set for deduplication

get_project_refs() deduplicates the walk results by scanning the result list for each appended element, so the cost grows quadratically with the number of projects, which is noticeable when walking a dev tree of 320 projects.

Track the already-seen projects in a set, and append an element only when it is new. The resulting list is unchanged, and the membership test is O(1) instead of O(n).

#### App.get_project_refs(): Use a set for deduplication get_project_refs() deduplicates the walk results by scanning the result list for each appended element, so the cost grows quadratically with the number of projects, which is noticeable when walking a dev tree of 320 projects. Track the already-seen projects in a set, and append an element only when it is new. The resulting list is unchanged, and the membership test is O(1) instead of O(n).
App.get_project_refs(): Use a set for deduplication
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m30s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m35s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m7s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m36s
CI / Packaging test (push) Successful in 0s
2e4afca5e3
get_project_refs() deduplicates the walk results by scanning the result
list for each appended element, so the cost grows quadratically with the
number of projects, which is noticeable when walking a dev tree of 320
projects.

Track the already-seen projects in a set, and append an element only when
it is new. The resulting list is unchanged, and the membership test is O(1)
instead of O(n).

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.86.1
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-09-22 09:22:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!120
No description provided.