refactor(core): retrieve the jsActionMap only once. (#60587)

Before the change, the map was pull on every loop execution.

PR Close #60587
This commit is contained in:
Matthieu Riegler
2025-03-27 16:49:54 +01:00
committed by Jessica Janiuk
parent 0c53970aeb
commit bae7b75ff5
+1 -1
View File
@@ -611,8 +611,8 @@ function gatherDeferBlocksByJSActionAttribute(doc: Document): Set<HTMLElement> {
export function appendDeferBlocksToJSActionMap(doc: Document, injector: Injector) {
const blockMap = gatherDeferBlocksByJSActionAttribute(doc);
const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP);
for (let rNode of blockMap) {
const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP);
sharedMapFunction(rNode, jsActionMap);
}
}