rust-index: use `IndexEntry::offset` to compute read segments
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 29 Jul 2024 15:03:52 +0200
changeset 52165 6f94dc3cf8cf
parent 52164 e01e84e5e426
child 52166 13815c9decd4
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.
rust/hg-core/src/revlog/index.rs
--- 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
     }