From 0b173b3db802df409ba83143f9fa246252ecb63d Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 12 Jan 2020 10:41:40 +0100 Subject: [PATCH] common: Use slice.swap() to clean up SectorHeaderIter::sort(). --- src/common/logger.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/logger.rs b/src/common/logger.rs index 022b155..95f4a43 100644 --- a/src/common/logger.rs +++ b/src/common/logger.rs @@ -252,9 +252,7 @@ impl<'a> SectorHeaderIter<'a> { } for i in (1..num_elts_to_sort).rev() { - let t = self.indices[0]; - self.indices[0] = self.indices[i]; - self.indices[i] = t; + self.indices.swap(0, i); downheap(&mut self.indices, 0, i - 1, self.sector_header); } -- 2.30.2