From 5b045d490db5c9705b29abca35cc9841c2fef70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rahir=20=28rar=29?= Date: Fri, 12 Apr 2024 12:06:02 +0200 Subject: [PATCH] [FIX] spreadsheet: speed-up clickable cell condition In `SET_FILTER_MATCHING_CONDITION` we would call `SEE_RECORDS_PIVOT_VISIBLE` twice but since the function returns a boolean value, the second call was useless as we already knew the outcome. This revision alleviates a bit the cost of computing the cells' clickable actions. On A sheet with 480 visible cells, each of them matching the full condition, the time spent in `getClickableCells` goes from 19ms to 14 ms on Google Chrome and from 42ms to 29 ms on Firefox. closes odoo/odoo#161656 Signed-off-by: Vincent Schippefilt (vsc) --- addons/spreadsheet/static/src/pivot/pivot_actions.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/spreadsheet/static/src/pivot/pivot_actions.js b/addons/spreadsheet/static/src/pivot/pivot_actions.js index 8e41669bada..87fd98af817 100644 --- a/addons/spreadsheet/static/src/pivot/pivot_actions.js +++ b/addons/spreadsheet/static/src/pivot/pivot_actions.js @@ -59,7 +59,6 @@ export function SET_FILTER_MATCHING_CONDITION(position, env) { const matchingFilters = env.model.getters.getFiltersMatchingPivotArgs(pivotId, domainArgs); const pivotFunction = getFirstPivotFunction(cell.compiledFormula.tokens).functionName; return ( - SEE_RECORDS_PIVOT_VISIBLE(position, env) && (pivotFunction === "ODOO.PIVOT" || pivotFunction === "ODOO.PIVOT.HEADER" || pivotFunction === "ODOO.PIVOT.TABLE") &&