Skip to content

Commit fac2d1f

Browse files
SilenceMMMMMMtrekhleb
authored andcommittedOct 23, 2018
use Destructuring in change data (trekhleb#233)
1 parent fad170c commit fac2d1f

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.