Skip to content

Commit

Permalink
use Destructuring in change data (trekhleb#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenceMMMMMM authored and trekhleb committed Oct 23, 2018
1 parent fad170c commit fac2d1f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/algorithms/sorting/selection-sort/SelectionSort.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export default class SelectionSort extends Sort {

// If new minimum element has been found then swap it with current i-th element.
if (minIndex !== i) {
const tmp = array[i];
array[i] = array[minIndex];
array[minIndex] = tmp;
[array[i], array[minIndex]] = [array[minIndex], array[i]];
}
}

Expand Down

0 comments on commit fac2d1f

Please sign in to comment.