From 2be5f9d6c9e53d3bba993e37067f142e78b94199 Mon Sep 17 00:00:00 2001 From: underfin Date: Fri, 15 Mar 2024 16:09:24 +0800 Subject: [PATCH] perf(codegen): avoid unnecessary copy (#2727) --- crates/oxc_codegen/src/sourcemap_builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_codegen/src/sourcemap_builder.rs b/crates/oxc_codegen/src/sourcemap_builder.rs index 043536f30..986f26574 100644 --- a/crates/oxc_codegen/src/sourcemap_builder.rs +++ b/crates/oxc_codegen/src/sourcemap_builder.rs @@ -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;