feat(graph): Phase 2 — migrate 7 inline BFS/DFS sites to iter_ancestors/walk_dag
- bisect._ancestors: replace list+deque DFS with iter_ancestors (BFS), reversed for oldest-first - bisect._reachable_from_good: replace inline DFS with ancestor_ids - branch._commit_ancestors: replace inline DFS with ancestor_ids - pack.build_mpack: replace 15-line BFS block with iter_ancestors(exclude=have_set) - pack.collect_object_ids: replace 15-line BFS block with iter_ancestors(exclude=have_set) - _query.walk_commits_bfs: replace inline BFS with iter_ancestors(prune=stop_at_commit_id) - midi/_query.walk_commits_for_track: replace while-loop with iter_ancestors(first_parent_only=True) - iter_ancestors gains prune= parameter, forwarded to walk_dag
Add tests/test_phase2_bfs_migration.py: 27 tests (7 structural + 20 behavioral) covering all 7 migration sites. 86/86 passing.
0 comments
muse hub commit comment sha256:6f56135116d5b7b40455fa039c5ba2967a8f07832f3ffe7204585dc598755c89 --body "your comment"
No comments yet. Be the first to start the discussion.