| ... | ... | @@ -1320,13 +1320,23 @@ const Fuzzer = struct { |
| 1320 | 1320 | |
| 1321 | 1321 | if (opts.copy != 0) { |
| 1322 | 1322 | if (opts.fresh == 0 or slice_i == data_slice.len) return .fresh; |
| 1323 | | return .{ .mutate = switch (uid.kind) { |
| 1324 | | .int => .{ .int = data.ints[data_i] }, |
| 1325 | | .bytes => .{ .bytes = b: { |
| 1323 | switch (uid.kind) { |
| 1324 | .int => { |
| 1325 | const int = data.ints[data_i]; |
| 1326 | if (weightsContain(int, weights)) { |
| 1327 | @branchHint(.likely); |
| 1328 | return .{ .mutate = .{ .int = int } }; |
| 1329 | } |
| 1330 | }, |
| 1331 | .bytes => { |
| 1326 | 1332 | const entry = data.bytes.entries[data_i]; |
| 1327 | | break :b data.bytes.table[entry.off..][0..entry.len]; |
| 1328 | | } }, |
| 1329 | | } }; |
| 1333 | const bytes = data.bytes.table[entry.off..][0..entry.len]; |
| 1334 | if (weightsContainBytes(bytes, weights)) { |
| 1335 | @branchHint(.likely); |
| 1336 | return .{ .mutate = .{ .bytes = bytes } }; |
| 1337 | } |
| 1338 | }, |
| 1339 | } |
| 1330 | 1340 | } |
| 1331 | 1341 | |
| 1332 | 1342 | if (!opts.splice) { |