aboutsummaryrefslogtreecommitdiff
path: root/src/sourcemap/sourcemap.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/sourcemap/sourcemap.zig')
-rw-r--r--src/sourcemap/sourcemap.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig
index e2d95c1ac..58c781762 100644
--- a/src/sourcemap/sourcemap.zig
+++ b/src/sourcemap/sourcemap.zig
@@ -542,7 +542,7 @@ pub fn decodeVLQ(encoded: []const u8, start: usize) VLQResult {
var vlq: u32 = 0;
// hint to the compiler what the maximum value is
- const encoded_ = encoded[start..][0..@minimum(encoded.len - start, comptime (vlq_max_in_bytes + 1))];
+ const encoded_ = encoded[start..][0..@min(encoded.len - start, comptime (vlq_max_in_bytes + 1))];
// inlining helps for the 1 or 2 byte case, hurts a little for larger
comptime var i: usize = 0;
@@ -616,7 +616,7 @@ pub const LineOffsetTable = struct {
pub fn generate(allocator: std.mem.Allocator, contents: []const u8, approximate_line_count: i32) List {
var list = List{};
// Preallocate the top-level table using the approximate line count from the lexer
- list.ensureUnusedCapacity(allocator, @intCast(usize, @maximum(approximate_line_count, 1))) catch unreachable;
+ list.ensureUnusedCapacity(allocator, @intCast(usize, @max(approximate_line_count, 1))) catch unreachable;
var column: i32 = 0;
var byte_offset_to_first_non_ascii: u32 = 0;
var column_byte_offset: u32 = 0;
@@ -675,7 +675,7 @@ pub const LineOffsetTable = struct {
}
} else {
switch (c) {
- (@maximum('\r', '\n') + 1)...127 => {
+ (@max('\r', '\n') + 1)...127 => {
// skip ahead to the next newline or non-ascii character
if (strings.indexOfNewlineOrNonASCIICheckStart(remaining, @as(u32, len_), false)) |j| {
column += @intCast(i32, j);
@@ -701,7 +701,7 @@ pub const LineOffsetTable = struct {
continue;
}
- var owned = columns_for_non_ascii.toOwnedSlice();
+ var owned = columns_for_non_ascii.toOwnedSlice() catch unreachable;
if (stack_fallback.fixed_buffer_allocator.ownsSlice(std.mem.sliceAsBytes(owned))) {
owned = allocator.dupe(i32, owned) catch unreachable;
}
@@ -744,7 +744,7 @@ pub const LineOffsetTable = struct {
}
}
{
- var owned = columns_for_non_ascii.toOwnedSlice();
+ var owned = columns_for_non_ascii.toOwnedSlice() catch unreachable;
if (stack_fallback.fixed_buffer_allocator.ownsSlice(std.mem.sliceAsBytes(owned))) {
owned = allocator.dupe(i32, owned) catch unreachable;
}
@@ -1093,7 +1093,7 @@ pub const Chunk = struct {
b.prev_loc = loc;
const list = b.line_offset_tables;
const original_line = LineOffsetTable.findLine(list, loc);
- const line = list.get(@intCast(usize, @maximum(original_line, 0)));
+ const line = list.get(@intCast(usize, @max(original_line, 0)));
// Use the line to compute the column
var original_column = loc.start - @intCast(i32, line.byte_offset_to_start_of_line);