From b9ba76f639aefaed40c829910bbf3aa8523737db Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 31 Oct 2024 12:33:07 +0000 Subject: [PATCH] Avoid creating new function every iteration of array.map --- packages/client/src/components/app/GridBlock.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/app/GridBlock.svelte b/packages/client/src/components/app/GridBlock.svelte index 3d9dcc028e..4a8dfb4fcb 100644 --- a/packages/client/src/components/app/GridBlock.svelte +++ b/packages/client/src/components/app/GridBlock.svelte @@ -62,7 +62,8 @@ export const getAdditionalDataContext = () => { const gridContext = grid?.getContext() const rows = get(gridContext?.rows) || [] - const cleaned = rows.map(gridContext?.rows.actions.cleanRow || (x => x)) + const clean = gridContext?.rows.actions.cleanRow || (x => x) + const cleaned = rows.map(clean) const goldenRow = generateGoldenSample(cleaned) const id = get(component).id return {