Skip to content

Commit 942173b

Browse files
author
Stjepan Glavina
committed
Fix grammar
1 parent cfe6e13 commit 942173b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libcore/slice/sort.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn partition_in_blocks<T, F>(v: &mut [T], pivot: &T, is_less: &mut F) -> usize
156156
// The partitioning algorithm repeats the following steps until completion:
157157
//
158158
// 1. Trace a block from the left side to identify elements greater than or equal to the pivot.
159-
// 2. Trace a block from the right side to identify elements less than the pivot.
159+
// 2. Trace a block from the right side to identify elements smaller than the pivot.
160160
// 3. Exchange the identified elements between the left and right side.
161161
//
162162
// 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
166166
// 3. `end` - End pointer into the `offsets` array.
167167
// 4. `offsets - Indices of out-of-order elements within the block.
168168

169-
// The current block on the left side: `v[l .. l + block_l]`.
169+
// The current block on the left side (from `l` to `l.offset(block_l)`).
170170
let mut l = v.as_mut_ptr();
171171
let mut block_l = BLOCK;
172172
let mut start_l = ptr::null_mut();
173173
let mut end_l = ptr::null_mut();
174174
let mut offsets_l: [u8; BLOCK] = unsafe { mem::uninitialized() };
175175

176-
// The current block on the right side: `v[r - block_r .. r]`.
176+
// The current block on the right side (from `r.offset(-block_r)` to `r`).
177177
let mut r = unsafe { l.offset(v.len() as isize) };
178178
let mut block_r = BLOCK;
179179
let mut start_r = ptr::null_mut();

0 commit comments

Comments
 (0)