- // Now put the indices of the unused directory entries in the array.
- if num_used == 0 {
- for i in 0..NUM_SECTORS {
- iter.indices[i] = i as u16;
- }
- } else {
- let latest_used = iter.indices[0] as usize;
- let mut offset_unused = num_used;
-
- // First put the entries that come after the latest one in use...
- for i in (latest_used + 1)..NUM_SECTORS {
- let sector_header = &iter.sector_header[i];
+ for i in (1..num_elts_to_sort).rev() {
+ self.indices.swap(0, i);