comparison rust/hg-core/src/revlog/index.rs @ 45591:f38adf8b0711

hg-core: Explain offset override of first revision (D8958#inline-14992 followup) Differential Revision: https://phab.mercurial-scm.org/D9095
author Antoine cezar<acezar@chwitlabs.fr>
date Mon, 28 Sep 2020 13:51:16 +0200
parents 11f3c3f408fd
children a886ffd2ffc6
comparison
equal deleted inserted replaced
45590:11f3c3f408fd 45591:f38adf8b0711
96 } 96 }
97 let start = rev as usize * INDEX_ENTRY_SIZE; 97 let start = rev as usize * INDEX_ENTRY_SIZE;
98 let end = start + INDEX_ENTRY_SIZE; 98 let end = start + INDEX_ENTRY_SIZE;
99 let bytes = &self.bytes[start..end]; 99 let bytes = &self.bytes[start..end];
100 100
101 // See IndexEntry for an explanation of this override. 101 // Override the offset of the first revision as its bytes are used
102 // for the index's metadata (saving space because it is always 0)
102 let offset_override = match rev { 103 let offset_override = match rev {
103 0 => Some(0), 104 0 => Some(0),
104 _ => None, 105 _ => None,
105 }; 106 };
106 107