diff --git a/App/lib/Stub/StubMerger/StubMergerTopo.vp b/App/lib/Stub/StubMerger/StubMergerTopo.vp index 175a874..10b297f 100644 --- a/App/lib/Stub/StubMerger/StubMergerTopo.vp +++ b/App/lib/Stub/StubMerger/StubMergerTopo.vp @@ -112,7 +112,6 @@ def BuildTopoSortedIndices(store_count: int, store_sha1_arr: bytes, if dsha1 is not None and StubMergerCollect._is_in_sha1_set(dsha1, reachable_set, reachable_count) != 0: indegree[si] = indegree[si] + 1 # Kahn:入度为 0(不依赖任何可达模块)者先出 → 最先编译 - q_head: int = 0 q_tail: int = 0 for i_r in range(rel_count): si2: int = rel_idx[i_r] @@ -120,9 +119,8 @@ def BuildTopoSortedIndices(store_count: int, store_sha1_arr: bytes, queue[q_tail] = si2 q_tail += 1 out_count: int = 0 - while q_head < q_tail: + for q_head in range(q_tail): m: int = queue[q_head] - q_head += 1 sorted_idx[out_count] = m out_count += 1 # 对依赖 m 的可达模块减入度