| ... | ... | @@ -118,11 +118,9 @@ pub fn main() !void { |
| 118 | 118 | switch (entry.kind) { |
| 119 | 119 | .directory => { |
| 120 | 120 | switch (walker.depth()) { |
| 121 | | 1 => for (def_dirs) |p| { |
| 122 | | if (std.mem.eql(u8, entry.basename, p)) { |
| 123 | | try walker.enter(entry); |
| 124 | | continue; |
| 125 | | } |
| 121 | 1 => if (def_dirs.get(entry.basename)) { |
| 122 | try walker.enter(entry); |
| 123 | continue; |
| 126 | 124 | }, |
| 127 | 125 | else => { |
| 128 | 126 | // The top-level directory was already validated |
| ... | ... | @@ -174,14 +172,14 @@ const def_exts = [_][]const u8{ |
| 174 | 172 | ".def.in", |
| 175 | 173 | }; |
| 176 | 174 | |
| 177 | | const def_dirs = [_][]const u8{ |
| 178 | | "lib32" ++ std.fs.path.sep_str, |
| 179 | | "lib64" ++ std.fs.path.sep_str, |
| 180 | | "libarm32" ++ std.fs.path.sep_str, |
| 181 | | "libarm64" ++ std.fs.path.sep_str, |
| 182 | | "lib-common" ++ std.fs.path.sep_str, |
| 183 | | "def-include" ++ std.fs.path.sep_str, |
| 184 | | }; |
| 175 | const def_dirs = std.StaticStringMap(void).initComptime(.{ |
| 176 | .{"lib32"}, |
| 177 | .{"lib64"}, |
| 178 | .{"libarm32"}, |
| 179 | .{"libarm64"}, |
| 180 | .{"lib-common"}, |
| 181 | .{"def-include"}, |
| 182 | }); |
| 185 | 183 | |
| 186 | 184 | const blacklisted_defs = [_][]const u8{ |
| 187 | 185 | "crtdll.def.in", |