Skip to content

Commit df02d43

Browse files
update to Zig 0.11.0-dev.3735+a72d634b7 (#14)
Signed-off-by: Eric Joldasov <[email protected]>
1 parent 2fd03fc commit df02d43

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DiffMatchPatch.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError
10001000
var overlap_length1: usize = diffCommonOverlap(deletion, insertion);
10011001
var overlap_length2: usize = diffCommonOverlap(insertion, deletion);
10021002
if (overlap_length1 >= overlap_length2) {
1003-
if (@intToFloat(f32, overlap_length1) >= @intToFloat(f32, deletion.len) / 2.0 or
1004-
@intToFloat(f32, overlap_length1) >= @intToFloat(f32, insertion.len) / 2.0)
1003+
if (@floatFromInt(f32, overlap_length1) >= @floatFromInt(f32, deletion.len) / 2.0 or
1004+
@floatFromInt(f32, overlap_length1) >= @floatFromInt(f32, insertion.len) / 2.0)
10051005
{
10061006
// Overlap found.
10071007
// Insert an equality and trim the surrounding edits.
@@ -1017,8 +1017,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError
10171017
pointer += 1;
10181018
}
10191019
} else {
1020-
if (@intToFloat(f32, overlap_length2) >= @intToFloat(f32, deletion.len) / 2.0 or
1021-
@intToFloat(f32, overlap_length2) >= @intToFloat(f32, insertion.len) / 2.0)
1020+
if (@floatFromInt(f32, overlap_length2) >= @floatFromInt(f32, deletion.len) / 2.0 or
1021+
@floatFromInt(f32, overlap_length2) >= @floatFromInt(f32, insertion.len) / 2.0)
10221022
{
10231023
// Reverse overlap found.
10241024
// Insert an equality and swap and trim the surrounding edits.

0 commit comments

Comments
 (0)