diff --git a/test/js-perf-test/ArraySort/sort-lengths.js b/test/js-perf-test/ArraySort/sort-lengths.js index 93a77712a1..f27805a0ef 100644 --- a/test/js-perf-test/ArraySort/sort-lengths.js +++ b/test/js-perf-test/ArraySort/sort-lengths.js @@ -9,6 +9,7 @@ function SortAsc() { } function Random(length) { + array_to_sort = []; for (let i = 0; i < length; ++i) { array_to_sort.push(Math.floor(Math.random() * length)); } @@ -16,21 +17,16 @@ function Random(length) { } function Sorted(length) { + array_to_sort = []; for (let i = 0; i < length; ++i) { array_to_sort.push(i); } AssertPackedSmiElements(); } -function TearDown() { - array_to_sort = []; -} - function CreateSortSuitesForLength(length) { - createSortSuite( - 'Random' + length, 1000, SortAsc, () => Random(length), TearDown); - createSortSuite( - 'Sorted' + length, 1000, SortAsc, () => Sorted(length), TearDown); + createSortSuite('Random' + length, 1000, SortAsc, () => Random(length)); + createSortSuite('Sorted' + length, 1000, SortAsc, () => Sorted(length)); } CreateSortSuitesForLength(10);