| ... | ... | @@ -90,10 +90,8 @@ fn findPrefix(cache: *const Cache, file_path: []const u8) !PrefixedPath { |
| 90 | 90 | fn findPrefixResolved(cache: *const Cache, resolved_path: []u8) !PrefixedPath { |
| 91 | 91 | const gpa = cache.gpa; |
| 92 | 92 | const cwd = cache.cwd; |
| 93 | | const prefixes_slice = cache.prefixes(); |
| 94 | | var i: u8 = 1; // Start at 1 to skip over checking the null prefix. |
| 95 | | while (i < prefixes_slice.len) : (i += 1) { |
| 96 | | const p = prefixes_slice[i].path.?; |
| 93 | for (cache.prefixes(), 0..) |prefix, i| { |
| 94 | const p = prefix.path orelse continue; |
| 97 | 95 | const sub_path = getPrefixSubpath(gpa, cwd, p, resolved_path) catch |err| switch (err) { |
| 98 | 96 | error.NotASubPath => continue, |
| 99 | 97 | else => |e| return e, |
| ... | ... | @@ -101,7 +99,7 @@ fn findPrefixResolved(cache: *const Cache, resolved_path: []u8) !PrefixedPath { |
| 101 | 99 | // Free the resolved path since we're not going to return it |
| 102 | 100 | gpa.free(resolved_path); |
| 103 | 101 | return .{ |
| 104 | | .prefix = i, |
| 102 | .prefix = @intCast(i), |
| 105 | 103 | .sub_path = sub_path, |
| 106 | 104 | }; |
| 107 | 105 | } |