From: Tilman Sauerbeck Date: Sun, 12 Jan 2020 09:41:40 +0000 (+0100) Subject: common: Use slice.swap() to clean up SectorHeaderIter::sort(). X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=0b173b3db802df409ba83143f9fa246252ecb63d;p=gps-watch.git common: Use slice.swap() to clean up SectorHeaderIter::sort(). --- 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); }