summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-02-14 13:13:24 +0100
committerLars Knoll <lars.knoll@qt.io>2020-02-27 09:59:08 +0100
commite30aa59a897ca3849fb99c6393cfb426ed22d33b (patch)
treef76ac69acf3f2b50193ff66b595733a66b108bdc
parent25677ec4b2957f7fd56618781dec28cb139f9df7 (diff)
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 <robert.loehning@qt.io>
-rw-r--r--src/gui/text/qtextengine.cpp3
1 files changed, 1 insertions, 2 deletions
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;