diff options
author | 2023-02-23 23:57:19 -0800 | |
---|---|---|
committer | 2023-02-23 23:57:19 -0800 | |
commit | 3f04f8d0a653cf5decef2225c2044742b382718a (patch) | |
tree | 91eb6500834e3157ecb9ab208101aa368a1191c8 /src/watcher.zig | |
parent | b5bdde28ed34070cbb1d34d13f414f4c513ee40d (diff) | |
download | bun-3f04f8d0a653cf5decef2225c2044742b382718a.tar.gz bun-3f04f8d0a653cf5decef2225c2044742b382718a.tar.zst bun-3f04f8d0a653cf5decef2225c2044742b382718a.zip |
Upgrade Zig (#2151)
* fixup
* Upgrade Zig
* Remove bad assertion
* strings
* bump
* mode -> optimize
* optimize
* Linux build
* Update bindgen.zig
Diffstat (limited to 'src/watcher.zig')
-rw-r--r-- | src/watcher.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/watcher.zig b/src/watcher.zig index 5b3fa5778..f35c16bc0 100644 --- a/src/watcher.zig +++ b/src/watcher.zig @@ -582,7 +582,7 @@ pub fn NewWatcher(comptime ContextType: type) type { var last_event_index: usize = 0; var last_event_id: INotify.EventListIndex = std.math.maxInt(INotify.EventListIndex); - for (all_events) |_, i| { + for (all_events, 0..) |_, i| { if (all_events[i].name_len > 0) { this.changed_filepaths[name_off] = temp_name_list[all_events[i].name_off]; all_events[i].name_off = name_off; @@ -609,7 +609,7 @@ pub fn NewWatcher(comptime ContextType: type) type { } pub fn indexOf(this: *Watcher, hash: HashType) ?u32 { - for (this.watchlist.items(.hash)) |other, i| { + for (this.watchlist.items(.hash), 0..) |other, i| { if (hash == other) { return @truncate(u32, i); } @@ -658,7 +658,7 @@ pub fn NewWatcher(comptime ContextType: type) type { const watchlist_id = this.watchlist.len; const file_path_: string = if (comptime copy_file_path) - std.mem.span(try this.allocator.dupeZ(u8, file_path)) + bun.asByteSlice(try this.allocator.dupeZ(u8, file_path)) else file_path; @@ -704,7 +704,7 @@ pub fn NewWatcher(comptime ContextType: type) type { } this.watchlist.appendAssumeCapacity(.{ - .file_path = std.mem.span(file_path_), + .file_path = file_path_, .fd = fd, .hash = hash, .count = 0, @@ -734,7 +734,7 @@ pub fn NewWatcher(comptime ContextType: type) type { var index: PlatformWatcher.EventListIndex = std.math.maxInt(PlatformWatcher.EventListIndex); const file_path_: string = if (comptime copy_file_path) - std.mem.span(try this.allocator.dupeZ(u8, file_path)) + bun.asByteSlice(try this.allocator.dupeZ(u8, file_path)) else file_path; |