From ed6444167f3860ab633b504d27fa16dc14ce7dd5 Mon Sep 17 00:00:00 2001 From: underfin Date: Fri, 15 Mar 2024 16:04:05 +0800 Subject: [PATCH] perf: avoid unnecessary copy --- 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 043536f303ca..986f265744da 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;