@@ -772,8 +772,9 @@ fn diffCleanupMerge(allocator: std.mem.Allocator, diffs: *DiffList) DiffError!vo
772
772
var nt = try allocator .alloc (u8 , diffs .items [ii ].text .len + common_length );
773
773
774
774
// try diffs.items[pointer - count_delete - count_insert - 1].text.append(allocator, text_insert.items[0..common_length]);
775
- std .mem .copy (u8 , nt , diffs .items [ii ].text );
776
- std .mem .copy (u8 , nt [diffs .items [ii ].text .len .. ], text_insert .items [0.. common_length ]);
775
+ const ot = diffs .items [ii ].text ;
776
+ @memcpy (nt [0.. ot .len ], ot );
777
+ @memcpy (nt [ot .len .. ], text_insert .items [0.. common_length ]);
777
778
778
779
// allocator.free(diffs.items[ii].text);
779
780
diffs .items [ii ].text = nt ;
@@ -825,8 +826,9 @@ fn diffCleanupMerge(allocator: std.mem.Allocator, diffs: *DiffList) DiffError!vo
825
826
var nt = try allocator .alloc (u8 , diffs .items [pointer - 1 ].text .len + diffs .items [pointer ].text .len );
826
827
827
828
// try diffs.items[pointer - count_delete - count_insert - 1].text.append(allocator, text_insert.items[0..common_length]);
828
- std .mem .copy (u8 , nt , diffs .items [pointer - 1 ].text );
829
- std .mem .copy (u8 , nt [diffs .items [pointer - 1 ].text .len .. ], diffs .items [pointer ].text );
829
+ const ot = diffs .items [pointer - 1 ].text ;
830
+ @memcpy (nt [0.. ot .len ], ot );
831
+ @memcpy (nt [ot .len .. ], diffs .items [pointer ].text );
830
832
831
833
// allocator.free(diffs.items[pointer - 1].text);
832
834
diffs .items [pointer - 1 ].text = nt ;
0 commit comments