From ac3793982383bfa6eeb067dd81dceb37ad58c462 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 6 May 2024 23:05:06 +0200 Subject: [PATCH] somehow fix normal select --- libselect/src/normal_select.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libselect/src/normal_select.rs b/libselect/src/normal_select.rs index 41eae30..3378844 100644 --- a/libselect/src/normal_select.rs +++ b/libselect/src/normal_select.rs @@ -53,8 +53,8 @@ impl NormalSelect { let mut chunks = list.chunks(5) .collect::>(); - for chunk in chunks.iter_mut() { - let chunk = self.insertion.sort(&chunk.to_vec()); + for mut chunk in chunks.iter_mut().map(|c| c.to_vec()) { + self.insertion.sort_mut(&mut chunk); medians.push(chunk[chunk.len() / 2]); }