From ae0f25431129f87c271e13c87ecba629529f8723 Mon Sep 17 00:00:00 2001 From: Pazzaz Date: Tue, 14 Aug 2018 20:56:22 +0200 Subject: Clarify dst condition --- src/liballoc/collections/vec_deque.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index b66bb82bc37..95d4b918df3 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -1882,18 +1882,18 @@ impl VecDeque { // Values are not copied one by one but as slices in `copy_whole_slice`. // What slices are used depends on various properties of src and dst. // There are 6 cases in total: - // 1. `src` and `dst` are contiguous - // 2. `src` is contiguous and `dst` is discontiguous - // 3. `src` is discontiguous and `dst` is contiguous - // 4. `src` and `dst` are discontiguous + // 1. `src` is contiguous and fits in dst_high + // 2. `src` is contiguous and does not fit in dst_high + // 3. `src` is discontiguous and fits in dst_high + // 4. `src` is discontiguous and does not fit in dst_high // + src_high is smaller than dst_high - // 5. `src` and `dst` are discontiguous + // 5. `src` is discontiguous and does not fit in dst_high // + dst_high is smaller than src_high - // 6. `src` and `dst` are discontiguous + // 6. `src` is discontiguous and does not fit in dst_high // + dst_high is the same size as src_high let src_contiguous = src_low.is_empty(); - let dst_contiguous = dst_high.len() >= src_total; - match (src_contiguous, dst_contiguous) { + let dst_high_fits_src = dst_high.len() >= src_total; + match (src_contiguous, dst_high_fits_src) { (true, true) => { // 1. // other [. . . o o o . . . . . .] -- cgit 1.4.1-3-g733a5