hg-core: minor code style change (D8958#inline-14993 followup)
authorAntoine cezar<acezar@chwitlabs.fr>
Mon, 28 Sep 2020 13:46:14 +0200
changeset 45590 11f3c3f408fd
parent 45589 3d5b2b8e93fd
child 45591 f38adf8b0711
hg-core: minor code style change (D8958#inline-14993 followup) Differential Revision: https://phab.mercurial-scm.org/D9083
rust/hg-core/src/revlog/index.rs
--- a/rust/hg-core/src/revlog/index.rs	Thu Sep 24 09:32:07 2020 +0200
+++ b/rust/hg-core/src/revlog/index.rs	Mon Sep 28 13:46:14 2020 +0200
@@ -21,7 +21,7 @@
             let mut offset: usize = 0;
             let mut offsets = Vec::new();
 
-            while (bytes.len() - offset) >= INDEX_ENTRY_SIZE {
+            while offset + INDEX_ENTRY_SIZE <= bytes.len() {
                 offsets.push(offset);
                 let end = offset + INDEX_ENTRY_SIZE;
                 let entry = IndexEntry {