Skip to content

Commit d073353

Browse files
committed
fix: avoid reduant copying
1 parent ec09483 commit d073353

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/x86.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pub unsafe fn escape_avx512(bytes: &[u8], result: &mut Vec<u8>) {
229229
}
230230
} else {
231231
// Fall back to AVX2 for small strings
232-
return escape_avx2(bytes, result);
232+
return escape_avx2(&bytes[start..], result);
233233
}
234234

235235
// Copy any remaining bytes
@@ -458,7 +458,7 @@ pub unsafe fn escape_avx2(bytes: &[u8], result: &mut Vec<u8>) {
458458
}
459459
} else {
460460
// Fall back to SSE2 for small strings
461-
return escape_sse2(bytes, result);
461+
return escape_sse2(&bytes[start..], result);
462462
}
463463

464464
// Copy any remaining bytes

0 commit comments

Comments
 (0)