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