mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
yet more comment improvements
This commit is contained in:
@@ -766,7 +766,7 @@ fn search_block(
|
||||
// In both cases, the block index of `end` is 1.
|
||||
// But we do want to search block 1 in (a), and we don't in (b).
|
||||
//
|
||||
// If we subtract 1 from both end positions to make them inclusive:
|
||||
// We subtract 1 from both end positions to make them inclusive:
|
||||
//
|
||||
// (a) 00000000|00000000 (b) 00000000|
|
||||
// ^~~~~~~~~~^ ^~~~~~~^
|
||||
@@ -937,7 +937,12 @@ pub fn is_range_initialized(&self, start: Size, end: Size) -> Result<(), Range<S
|
||||
pub fn range_as_init_chunks(&self, start: Size, end: Size) -> InitChunkIter<'_> {
|
||||
assert!(end <= self.len);
|
||||
|
||||
let is_init = if start < end { self.get(start) } else { false };
|
||||
let is_init = if start < end {
|
||||
self.get(start)
|
||||
} else {
|
||||
// `start..end` is empty: there are no chunks, so use some arbitrary value
|
||||
false
|
||||
};
|
||||
|
||||
InitChunkIter { init_mask: self, is_init, start, end }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user