Patchwork D9095: hg-core: Explain offset override of first revision (D8958#inline-14992 followup)

login
register
mail settings
Submitter phabricator
Date Sept. 28, 2020, 1:48 p.m.
Message ID <differential-rev-PHID-DREV-fw4j5tyaxlvbvbc2hqo7-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47310/
State Superseded
Headers show

Comments

phabricator - Sept. 28, 2020, 1:48 p.m.
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9095

AFFECTED FILES
  rust/hg-core/src/revlog/index.rs

CHANGE DETAILS




To: acezar, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/revlog/index.rs b/rust/hg-core/src/revlog/index.rs
--- a/rust/hg-core/src/revlog/index.rs
+++ b/rust/hg-core/src/revlog/index.rs
@@ -98,7 +98,8 @@ 
         let end = start + INDEX_ENTRY_SIZE;
         let bytes = &self.bytes[start..end];
 
-        // See IndexEntry for an explanation of this override.
+        // Override the offset of the first revision as its bytes are used
+        // for index's metadata (saving space because it is alway 0)
         let offset_override = match rev {
             0 => Some(0),
             _ => None,