Skip to content

Commit

Permalink
refactor(grid-iterators): minor update columns2d()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Oct 9, 2023
1 parent 104b320 commit 7ecb207
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/grid-iterators/src/columns.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { map } from "@thi.ng/transducers/map";
import { range2d } from "@thi.ng/transducers/range2d";
import { repeatedly2d } from "@thi.ng/transducers/repeatedly2d";
import type { GridIterOpts2D } from "./api.js";
import { __opts } from "./utils.js";

Expand All @@ -10,5 +9,5 @@ import { __opts } from "./utils.js";
*/
export const columns2d = (opts: GridIterOpts2D) => {
const { cols, rows, tx } = __opts(opts);
return map((p) => tx(p[1], p[0]), range2d(rows | 0, cols | 0));
return repeatedly2d((y, x) => tx(x, y), rows | 0, cols | 0);
};

0 comments on commit 7ecb207

Please sign in to comment.