migration: std.math.{min, min3, max, max3} -> @min & @max

This commit is contained in:
r00ster91
2023-06-02 22:02:45 -04:00
committed by Andrew Kelley
parent 22c6b6c9a9
commit 2593156068
58 changed files with 173 additions and 264 deletions

View File

@@ -815,9 +815,9 @@ pub fn ArrayHashMapUnmanaged(
/// no longer guaranteed that no allocations will be performed.
pub fn capacity(self: Self) usize {
const entry_cap = self.entries.capacity;
const header = self.index_header orelse return math.min(linear_scan_max, entry_cap);
const header = self.index_header orelse return @min(linear_scan_max, entry_cap);
const indexes_cap = header.capacity();
return math.min(entry_cap, indexes_cap);
return @min(entry_cap, indexes_cap);
}
/// Clobbers any existing data. To detect if a put would clobber
@@ -1821,7 +1821,7 @@ fn Index(comptime I: type) type {
/// length * the size of an Index(u32). The index is 8 bytes (3 bits repr)
/// and max_usize + 1 is not representable, so we need to subtract out 4 bits.
const max_representable_index_len = @bitSizeOf(usize) - 4;
const max_bit_index = math.min(32, max_representable_index_len);
const max_bit_index = @min(32, max_representable_index_len);
const min_bit_index = 5;
const max_capacity = (1 << max_bit_index) - 1;
const index_capacities = blk: {