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

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