From fd1fea5f6a12074e4436948fb172f64c42ff8a77 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 17 Mar 2026 16:00:19 +0100 Subject: [PATCH] Remove some useless operations when getting the text content The removed code has been added in #20624 and it's useless since these operations (i.e. save/restore) are already handled in preprocessor.read. --- src/core/evaluator.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index eddde0788..3a93c086f 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -3197,6 +3197,9 @@ class PartialEvaluator { break; } + // preprocessor.read() already handles save, restore and transform + // operations, so we don't need to worry about them here. + textState = stateManager.state; currentTextState ||= textState.clone(); const fn = operation.fn; @@ -3570,12 +3573,6 @@ class PartialEvaluator { }); } break; - case OPS.restore: - stateManager.restore(); - break; - case OPS.save: - stateManager.save(); - break; } // switch if (textContent.items.length >= (sink?.desiredSize ?? 1)) { // Wait for ready, if we reach highWaterMark.