@@ -772,8 +772,9 @@ fn diffCleanupMerge(allocator: std.mem.Allocator, diffs: *DiffList) DiffError!vo
772772 var nt = try allocator .alloc (u8 , diffs .items [ii ].text .len + common_length );
773773
774774 // 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 ]);
777778
778779 // allocator.free(diffs.items[ii].text);
779780 diffs .items [ii ].text = nt ;
@@ -825,8 +826,9 @@ fn diffCleanupMerge(allocator: std.mem.Allocator, diffs: *DiffList) DiffError!vo
825826 var nt = try allocator .alloc (u8 , diffs .items [pointer - 1 ].text .len + diffs .items [pointer ].text .len );
826827
827828 // 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 );
830832
831833 // allocator.free(diffs.items[pointer - 1].text);
832834 diffs .items [pointer - 1 ].text = nt ;
0 commit comments