aboutsummaryrefslogtreecommitdiff
path: root/src/deps/diffz
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-07-11 19:14:34 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-11 19:14:34 -0700
commitcbb88672f217a90db1aa1eb29cd92d5d9035b22b (patch)
tree43a00501f3cde495967e116f0b660777051551f8 /src/deps/diffz
parent1f900cff453700b19bca2acadfe26da4468c1282 (diff)
parent34b0e7a2bbd8bf8097341cdb0075d0908283e834 (diff)
downloadbun-jarred/esm-conditions.tar.gz
bun-jarred/esm-conditions.tar.zst
bun-jarred/esm-conditions.zip
Merge branch 'main' into jarred/esm-conditionsjarred/esm-conditions
Diffstat (limited to '')
-rw-r--r--src/deps/diffz/DiffMatchPatch.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/deps/diffz/DiffMatchPatch.zig b/src/deps/diffz/DiffMatchPatch.zig
index 7e545f364..a5cc02af4 100644
--- a/src/deps/diffz/DiffMatchPatch.zig
+++ b/src/deps/diffz/DiffMatchPatch.zig
@@ -178,7 +178,7 @@ fn diffInternal(
}
fn diffCommonPrefix(before: []const u8, after: []const u8) usize {
- const n = std.math.min(before.len, after.len);
+ const n = @min(before.len, after.len);
var i: usize = 0;
while (i < n) : (i += 1) {
@@ -191,7 +191,7 @@ fn diffCommonPrefix(before: []const u8, after: []const u8) usize {
}
fn diffCommonSuffix(before: []const u8, after: []const u8) usize {
- const n = std.math.min(before.len, after.len);
+ const n = @min(before.len, after.len);
var i: usize = 1;
while (i <= n) : (i += 1) {
@@ -996,8 +996,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError
// Eliminate an equality that is smaller or equal to the edits on both
// sides of it.
if (last_equality != null and
- (last_equality.?.len <= std.math.max(length_insertions1, length_deletions1)) and
- (last_equality.?.len <= std.math.max(length_insertions2, length_deletions2)))
+ (last_equality.?.len <= @max(length_insertions1, length_deletions1)) and
+ (last_equality.?.len <= @max(length_insertions2, length_deletions2)))
{
// Duplicate record.
try diffs.insert(
@@ -1046,8 +1046,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError
var overlap_length1: usize = diffCommonOverlap(deletion, insertion);
var overlap_length2: usize = diffCommonOverlap(insertion, deletion);
if (overlap_length1 >= overlap_length2) {
- if (@intToFloat(f32, overlap_length1) >= @intToFloat(f32, deletion.len) / 2.0 or
- @intToFloat(f32, overlap_length1) >= @intToFloat(f32, insertion.len) / 2.0)
+ if (@floatFromInt(f32, overlap_length1) >= @floatFromInt(f32, deletion.len) / 2.0 or
+ @floatFromInt(f32, overlap_length1) >= @floatFromInt(f32, insertion.len) / 2.0)
{
// Overlap found.
// Insert an equality and trim the surrounding edits.
@@ -1063,8 +1063,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError
pointer += 1;
}
} else {
- if (@intToFloat(f32, overlap_length2) >= @intToFloat(f32, deletion.len) / 2.0 or
- @intToFloat(f32, overlap_length2) >= @intToFloat(f32, insertion.len) / 2.0)
+ if (@floatFromInt(f32, overlap_length2) >= @floatFromInt(f32, deletion.len) / 2.0 or
+ @floatFromInt(f32, overlap_length2) >= @floatFromInt(f32, insertion.len) / 2.0)
{
// Reverse overlap found.
// Insert an equality and swap and trim the surrounding edits.