aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-08-04 10:47:11 +0200
committerJakub Konka <kubkon@jakubkonka.com>2021-08-12 10:20:57 +0200
commitf49aa960a93b401b8e33292cf37a0de1eec312c0 (patch)
treebaf74bb34105f6cb4b14d84614fe3423b162e2a6 /src
parentf01366e8b3ff46831feef2ceb13c5602c0ae3e99 (diff)
downloadzig-f49aa960a93b401b8e33292cf37a0de1eec312c0.tar.gz
zig-f49aa960a93b401b8e33292cf37a0de1eec312c0.zip
macho: use ArrayHashMap.popOrNull where applicable
Diffstat (limited to 'src')
-rw-r--r--src/link/MachO.zig7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index 17e17f13f0..b390b5f58a 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -2329,11 +2329,8 @@ fn resolveSymbols(self: *MachO) !void {
// Convert any tentative definition into a regular symbol and allocate
// text blocks for each tentative defintion.
- var tentatives_count: usize = 0;
- const ntentatives = tentatives.count();
- while (tentatives_count < ntentatives) : (tentatives_count += 1) {
- const index = tentatives.pop().key;
- const sym = &self.globals.items[index];
+ while (tentatives.popOrNull()) |entry| {
+ const sym = &self.globals.items[entry.key];
const match: MatchingSection = blk: {
if (self.common_section_index == null) {
const data_seg = &self.load_commands.items[self.data_segment_cmd_index.?].Segment;