Skip to content

Commit cc9de1e

Browse files
committed
chore: avoid the use of callbacks to fill the rows
1 parent a80cfea commit cc9de1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class SparseMatrix {
6868
*/
6969
to2DArray() {
7070
const copy = Array.from({ length: this.rows }, () =>
71-
Array.from({ length: this.columns }, () => 0),
71+
new Array(this.columns).fill(0),
7272
);
7373
this.withEachNonZero((i, j, v) => {
7474
copy[i][j] = v;

0 commit comments

Comments
 (0)