Speed up QTextEngine::setBoundary
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 19 Jul 2012 12:42:37 +0000 (14:42 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 23 Aug 2012 21:31:10 +0000 (23:31 +0200)
commitc13011829fd39661cc9e983256766c6edb88dead
treeabde4558f2adb6c7ee90b1f5115b2b9c91346edf
parent4f6efe16416f0222ae78ab16c0eb8085bf9c521b
Speed up QTextEngine::setBoundary

Before, setBoundary was O(N), now it is O(log N) assuming the boundaries
are added in order. (splitItem might still be linear because of the call
to QVector::insert)

This speeds up a lot QTextEngine::addRequiredBoundaries when there is a
lot of addFormats. (For example if there is a very long line with syntax
highlighting)

Task-number: QTBUG-8389
Change-Id: I10c9fca72343f46db24b1d4f519f7747188d4009
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/gui/text/qtextengine.cpp