mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-09-20 07:43:04 +08:00
Merge eb8ca90bb0
into ca3d16dcce
This commit is contained in:
commit
441e96ff1c
@ -21,9 +21,7 @@ export default class ShellSort extends Sort {
|
||||
|
||||
// Compare and swap array elements if needed.
|
||||
if (this.comparator.lessThan(array[gapShiftedIndex], array[currentIndex])) {
|
||||
const tmp = array[currentIndex];
|
||||
array[currentIndex] = array[gapShiftedIndex];
|
||||
array[gapShiftedIndex] = tmp;
|
||||
[array[currentIndex], array[gapShiftedIndex]] = [array[gapShiftedIndex], array[currentIndex]];
|
||||
}
|
||||
|
||||
gapShiftedIndex = currentIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user