From e30aa59a897ca3849fb99c6393cfb426ed22d33b Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 14 Feb 2020 13:13:24 +0100 Subject: Fix a quadratic behavior in the BiDi algorithm Reset the lastETPosition after we changed DirET to DirEN, to avoid iterating over the same set of characters many times. Change-Id: Ib4113d0ba87ad70fc6bb386632eb094f943c080d Reviewed-by: Robert Loehning --- src/gui/text/qtextengine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 209433dac5..cd056a743a 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -712,9 +712,8 @@ struct QBidiAlgorithm { analysis[pos].bidiDirection = QChar::DirEN; ++it; } - } else { - lastETPosition.clear(); } + lastETPosition.clear(); } last = current; lastPos = pos; -- cgit v1.2.3