From b3946be414d9835181927c267c00cf542dcbc83c Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Tue, 27 Jun 2023 02:28:47 -0700 Subject: [PATCH] conflicts: avoid unnecessary cloning of conflict content --- lib/src/conflicts.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/conflicts.rs b/lib/src/conflicts.rs index 542278645..c64980cb4 100644 --- a/lib/src/conflicts.rs +++ b/lib/src/conflicts.rs @@ -247,11 +247,11 @@ impl Conflict> { } } MergeHunk::Conflict(ConflictHunk { removes, adds }) => { - for (i, buf) in removes.iter().enumerate() { - removed_content[i].extend_from_slice(buf); + for (i, buf) in removes.into_iter().enumerate() { + removed_content[i].extend(buf); } - for (i, buf) in adds.iter().enumerate() { - added_content[i].extend_from_slice(buf); + for (i, buf) in adds.into_iter().enumerate() { + added_content[i].extend(buf); } } }