changeset 363:40c6e26ad2c5

version: Fix sorting order of files returned by get_overlapping()
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 07 Oct 2017 21:22:38 +0200
parents 6a1a111f508e
children 8ef8559c6072
files src/version.rs
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.rs	Fri Oct 06 06:18:27 2017 +0000
+++ b/src/version.rs	Sat Oct 07 21:22:38 2017 +0200
@@ -103,7 +103,8 @@
                 levels[0].push(f_.clone());
             }
         }
-        levels[0].sort_by(|a, b| a.borrow().num.cmp(&b.borrow().num));
+        // Sort by newest first.
+        levels[0].sort_by(|a, b| b.borrow().num.cmp(&a.borrow().num));
 
         let icmp = InternalKeyCmp(self.user_cmp.clone());
         for level in 1..NUM_LEVELS {