perf(codegen): avoid unnecessary copy (#2727)

This commit is contained in:
underfin 2024-03-15 16:09:24 +08:00 committed by GitHub
parent 798a1fde09
commit 2be5f9d6c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -173,7 +173,7 @@ impl SourcemapBuilder {
});
let remaining = &content.as_bytes()[line_byte_offset..];
for (mut byte_offset_from_line_start, b) in remaining.iter().copied().enumerate() {
for (mut byte_offset_from_line_start, b) in remaining.iter().enumerate() {
match b {
b'\n' => {
byte_offset_from_line_start += 1;