Skip to content

Commit 3acae85

Browse files
SilenceMMMMMMshoredata
authored andcommittedMar 28, 2019
use Destructuring in change data (trekhleb#233)
1 parent 9f44453 commit 3acae85

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

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

+1-3
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)
Please sign in to comment.