[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) <vsc@odoo.com>
This commit is contained in:
Rémi Rahir (rar)
2024-04-12 12:56:41 +00:00
parent fc42effbdf
commit 5b045d490d
@@ -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") &&