| ... | ... | @@ -2115,6 +2115,7 @@ pub const Manifest = struct { |
| 2115 | 2115 | assert(@typeInfo(std.zig.Server.Message.PathPrefix).@"enum".field_names.len == discovered.cache.prefixes_len); |
| 2116 | 2116 | assert(discovered.cache.prefixes_len == 5); |
| 2117 | 2117 | |
| 2118 | const discovered_files = discovered.files.keys(); |
| 2118 | 2119 | const orig_files_len = m.files.count(); |
| 2119 | 2120 | const orig_contents_len = m.contents.items.len; |
| 2120 | 2121 | errdefer { |
| ... | ... | @@ -2122,13 +2123,14 @@ pub const Manifest = struct { |
| 2122 | 2123 | m.contents.shrinkRetainingCapacity(orig_contents_len); |
| 2123 | 2124 | } |
| 2124 | 2125 | |
| 2125 | | for (discovered.files.keys(), 0..) |off, file_index| { |
| 2126 | for (discovered_files, 0..) |off, file_index| { |
| 2126 | 2127 | try m.files.ensureUnusedCapacityContext(gpa, 1, .{ .contents = m.contents.items }); |
| 2127 | 2128 | |
| 2128 | | const next_off = if (file_index < discovered.files.count()) |
| 2129 | | @backingInt(discovered.files.keys()[file_index + 1]) |
| 2129 | const next_index = file_index + 1; |
| 2130 | const next_off = if (discovered_files.len - next_index == 0) |
| 2131 | discovered.contents.items.len |
| 2130 | 2132 | else |
| 2131 | | discovered.contents.items.len; |
| 2133 | @backingInt(discovered_files[next_index]); |
| 2132 | 2134 | |
| 2133 | 2135 | const copy_bytes = discovered.contents.items[@backingInt(off)..next_off]; |
| 2134 | 2136 | const prev_contents_len: File.Offset = @fromBackingInt(@intCast(m.contents.items.len)); |