Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5e0e571

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents af9de0f + fac2d1f commit 5e0e571

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

‎src/algorithms/sorting/selection-sort/SelectionSort.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ export default class SelectionSort extends Sort {
2323

2424
// If new minimum element has been found then swap it with current i-th element.
2525
if (minIndex !== i) {
26-
const tmp = array[i];
27-
array[i] = array[minIndex];
28-
array[minIndex] = tmp;
26+
[array[i], array[minIndex]] = [array[minIndex], array[i]];
2927
}
3028
}
3129

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /