aboutsummaryrefslogtreecommitdiff
path: root/src/deps/diffz
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-02-24 15:53:26 +0200
committerGravatar GitHub <noreply@github.com> 2023-02-24 05:53:26 -0800
commite887a064fb63347b4a4b21c282c1db01dfee98b1 (patch)
tree6270a7ce5527ea06d709d4b92e14623518e0f5b5 /src/deps/diffz
parent6e4908e51793d82d3b6924b2ede9a02f1e95bf37 (diff)
downloadbun-e887a064fb63347b4a4b21c282c1db01dfee98b1.tar.gz
bun-e887a064fb63347b4a4b21c282c1db01dfee98b1.tar.zst
bun-e887a064fb63347b4a4b21c282c1db01dfee98b1.zip
prefer `bun.copy()` over `std.mem.copy()` (#2152)
Diffstat (limited to 'src/deps/diffz')
-rw-r--r--src/deps/diffz/DiffMatchPatch.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/deps/diffz/DiffMatchPatch.zig b/src/deps/diffz/DiffMatchPatch.zig
index a85bc950d..4603aee1b 100644
--- a/src/deps/diffz/DiffMatchPatch.zig
+++ b/src/deps/diffz/DiffMatchPatch.zig
@@ -23,6 +23,7 @@
const DiffMatchPatch = @This();
const std = @import("std");
+const bun = @import("bun");
const testing = std.testing;
const ArrayListUnmanaged = std.ArrayListUnmanaged;
const DiffList = ArrayListUnmanaged(Diff);
@@ -817,8 +818,8 @@ fn diffCleanupMerge(allocator: std.mem.Allocator, diffs: *DiffList) DiffError!vo
var nt = try allocator.alloc(u8, diffs.items[ii].text.len + common_length);
// try diffs.items[pointer - count_delete - count_insert - 1].text.append(allocator, text_insert.items[0..common_length]);
- std.mem.copy(u8, nt, diffs.items[ii].text);
- std.mem.copy(u8, nt[diffs.items[ii].text.len..], text_insert.items[0..common_length]);
+ bun.copy(u8, nt, diffs.items[ii].text);
+ bun.copy(u8, nt[diffs.items[ii].text.len..], text_insert.items[0..common_length]);
// allocator.free(diffs.items[ii].text);
diffs.items[ii].text = nt;
@@ -870,8 +871,8 @@ fn diffCleanupMerge(allocator: std.mem.Allocator, diffs: *DiffList) DiffError!vo
var nt = try allocator.alloc(u8, diffs.items[pointer - 1].text.len + diffs.items[pointer].text.len);
// try diffs.items[pointer - count_delete - count_insert - 1].text.append(allocator, text_insert.items[0..common_length]);
- std.mem.copy(u8, nt, diffs.items[pointer - 1].text);
- std.mem.copy(u8, nt[diffs.items[pointer - 1].text.len..], diffs.items[pointer].text);
+ bun.copy(u8, nt, diffs.items[pointer - 1].text);
+ bun.copy(u8, nt[diffs.items[pointer - 1].text.len..], diffs.items[pointer].text);
// allocator.free(diffs.items[pointer - 1].text);
diffs.items[pointer - 1].text = nt;