diff options
Diffstat (limited to 'src/hive_array.zig')
-rw-r--r-- | src/hive_array.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hive_array.zig b/src/hive_array.zig index cc032c44f..a29fe6842 100644 --- a/src/hive_array.zig +++ b/src/hive_array.zig @@ -34,7 +34,7 @@ pub fn HiveArray(comptime T: type, comptime capacity: u16) type { self.available.unset(index); } - pub fn indexOf(self: *const Self, value: *const T) ?u63 { + pub fn indexOf(self: *const Self, value: *const T) ?u32 { const start = &self.buffer; const end = @ptrCast([*]const T, start) + capacity; if (!(@ptrToInt(value) >= @ptrToInt(start) and @ptrToInt(value) < @ptrToInt(end))) @@ -44,7 +44,7 @@ pub fn HiveArray(comptime T: type, comptime capacity: u16) type { const index = (@ptrToInt(value) - @ptrToInt(start)) / @sizeOf(T); assert(index < capacity); assert(&self.buffer[index] == value); - return @truncate(u63, index); + return @intCast(u32, index); } pub fn in(self: *const Self, value: *const T) bool { |