Skip to content

Commit ce5227e

Browse files
committed
Revert "refactor: use const for shuffled in getRandomSubarray function"
This reverts commit 668f9a4.
1 parent d62f43b commit ce5227e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/views/DataThread.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ export const DataThread: FC<{}> = function ({ }) {
387387
return x - Math.floor(x);
388388
}
389389
const getRandomSubarray = (arr: any[], size: number) => {
390-
const shuffled = arr.slice(0);
391-
let i = arr.length, temp, index;
390+
let shuffled = arr.slice(0), i = arr.length, temp, index;
392391
while (i--) {
393392
index = Math.floor((i + 1) * getRandom(233 * i + 888));
394393
temp = shuffled[index];

src/views/EncodingShelfThread.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ export const ChartElementFC: FC<{chart: Chart, tableRows: any[], boxWidth?: numb
9494
return x - Math.floor(x);
9595
}
9696
const getRandomSubarray = (arr: any[], size: number) => {
97-
const shuffled = arr.slice(0);
98-
let i = arr.length, temp, index;
97+
let shuffled = arr.slice(0), i = arr.length, temp, index;
9998
while (i--) {
10099
index = Math.floor((i + 1) * getRandom(233 * i + 888));
101100
temp = shuffled[index];

0 commit comments

Comments
 (0)