We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fe8822 commit b9e519cCopy full SHA for b9e519c
src/sorting-algorithms.ts
@@ -259,6 +259,10 @@ export class SortingAlgorithms {
259
const bucketStart = currentIndex;
260
for (const a of bucket) {
261
const swapIndex = indexMap[a.id];
262
+ if (swapIndex === currentIndex) {
263
+ currentIndex++;
264
+ continue;
265
+ }
266
await this.drawAndSwap(arr, currentIndex, swapIndex);
267
268
indexMap[arr[swapIndex].id] = indexMap[arr[currentIndex].id];
0 commit comments