changeset 52165:6f94dc3cf8cf

rust-index: use `IndexEntry::offset` to compute read segments This only matters for inline revlogs where the impact is debatable, but this is what the C index does.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 29 Jul 2024 15:03:52 +0200
parents e01e84e5e426
children 13815c9decd4
files rust/hg-core/src/revlog/index.rs
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/index.rs	Thu Oct 10 10:34:51 2024 +0200
+++ b/rust/hg-core/src/revlog/index.rs	Mon Jul 29 15:03:52 2024 +0200
@@ -1006,11 +1006,10 @@
         }
         let last_rev = revs[revs.len() - 1];
         let last_entry = &self.get_entry(last_rev).unwrap();
-        let end = self.start(last_rev, last_entry)
-            + last_entry.compressed_len() as usize;
+        let end = last_entry.offset() + last_entry.compressed_len() as usize;
         let first_rev = revs.iter().find(|r| r.0 != NULL_REVISION.0).unwrap();
         let first_entry = self.get_entry(*first_rev).unwrap();
-        let start = self.start(*first_rev, &first_entry);
+        let start = first_entry.offset();
         end - start
     }