diff options
| author | Stjepan Glavina <stjepang@gmail.com> | 2017-03-18 15:42:07 +0100 |
|---|---|---|
| committer | Stjepan Glavina <stjepang@gmail.com> | 2017-03-21 20:46:20 +0100 |
| commit | 942173b38fc0c202e8f28f266d6c4df4acfc5a91 (patch) | |
| tree | 7c7cd0b6305f686d3fd55d2e56eaa25cd13b445b | |
| parent | cfe6e13b119b311c8846b762d1dabe0d58eb5e5c (diff) | |
| download | rust-942173b38fc0c202e8f28f266d6c4df4acfc5a91.tar.gz rust-942173b38fc0c202e8f28f266d6c4df4acfc5a91.zip | |
Fix grammar
| -rw-r--r-- | src/libcore/slice/sort.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index 74a0a14a4c5..9cd7009ad29 100644 --- a/src/libcore/slice/sort.rs +++ b/src/libcore/slice/sort.rs @@ -156,7 +156,7 @@ fn partition_in_blocks<T, F>(v: &mut [T], pivot: &T, is_less: &mut F) -> usize // The partitioning algorithm repeats the following steps until completion: // // 1. Trace a block from the left side to identify elements greater than or equal to the pivot. - // 2. Trace a block from the right side to identify elements less than the pivot. + // 2. Trace a block from the right side to identify elements smaller than the pivot. // 3. Exchange the identified elements between the left and right side. // // We keep the following variables for a block of elements: @@ -166,14 +166,14 @@ fn partition_in_blocks<T, F>(v: &mut [T], pivot: &T, is_less: &mut F) -> usize // 3. `end` - End pointer into the `offsets` array. // 4. `offsets - Indices of out-of-order elements within the block. - // The current block on the left side: `v[l .. l + block_l]`. + // The current block on the left side (from `l` to `l.offset(block_l)`). let mut l = v.as_mut_ptr(); let mut block_l = BLOCK; let mut start_l = ptr::null_mut(); let mut end_l = ptr::null_mut(); let mut offsets_l: [u8; BLOCK] = unsafe { mem::uninitialized() }; - // The current block on the right side: `v[r - block_r .. r]`. + // The current block on the right side (from `r.offset(-block_r)` to `r`). let mut r = unsafe { l.offset(v.len() as isize) }; let mut block_r = BLOCK; let mut start_r = ptr::null_mut(); |
