Rollup merge of #119205 - mumbleskates:vecdeque-comment-fix, r=Mark-Simulacrum

fix minor mistake in comments describing VecDeque resizing

Avoiding confusion where one of the items in the deque seems to disappear in two of the three cases
This commit is contained in:
Matthias Krüger 2023-12-24 01:08:09 +01:00 committed by GitHub
commit 89c3236789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -492,11 +492,11 @@ unsafe fn handle_capacity_increase(&mut self, old_capacity: usize) {
// L H // L H
// [o o o o o o o o ] // [o o o o o o o o ]
// H L // H L
// B [. . . o o o o o o o . . . . . . ] // B [. . . o o o o o o o o . . . . . ]
// L H // L H
// [o o o o o o o o ] // [o o o o o o o o ]
// L H // L H
// C [o o o o o . . . . . . . . . o o ] // C [o o o o o o . . . . . . . . o o ]
// can't use is_contiguous() because the capacity is already updated. // can't use is_contiguous() because the capacity is already updated.
if self.head <= old_capacity - self.len { if self.head <= old_capacity - self.len {