mirror of
https://github.com/ziglang/zig.git
synced 2026-01-26 09:15:24 +00:00
InternPool: fix DependencyIterator iteration
This commit is contained in:
parent
a20d081129
commit
7dbd2a6bb5
@ -283,10 +283,12 @@ pub const DependencyIterator = struct {
|
||||
ip: *const InternPool,
|
||||
next_entry: DepEntry.Index.Optional,
|
||||
pub fn next(it: *DependencyIterator) ?AnalUnit {
|
||||
const idx = it.next_entry.unwrap() orelse return null;
|
||||
const entry = it.ip.dep_entries.items[@intFromEnum(idx)];
|
||||
it.next_entry = entry.next;
|
||||
return entry.depender.unwrap().?;
|
||||
while (true) {
|
||||
const idx = it.next_entry.unwrap() orelse return null;
|
||||
const entry = it.ip.dep_entries.items[@intFromEnum(idx)];
|
||||
it.next_entry = entry.next;
|
||||
if (entry.depender.unwrap()) |depender| return depender;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user