diff options
author | Marc Mutz <[email protected]> | 2022-12-26 22:46:41 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2022-12-27 14:30:43 +0000 |
commit | f255960f97c4561106bfa5c0d4989e9c6ae192f1 (patch) | |
tree | a752bc78d0651187546148b079de8db2987cab6b | |
parent | 7cfc729f415776f7388a18fc518e289d45f1f5ed (diff) |
QTextDocumentPrivate: de-inline {add,remove}Cursor()
In a 'ninja qtdeclarative' build, the addCursor() function alone is
compiled 458x for a total of almost 10s cumulative compilation time.
This makes it one of the top-20 template instantiations in a Clang
-ftime-trace build.
The removeCursor() function doesn't show up quite as much, but
de-inline, too, while we're at it.
Task-number: QTBUG-97601
Change-Id: I37b920a8b364861efab78f736d71642dc82d8982
Reviewed-by: Thiago Macieira <[email protected]>
(cherry picked from commit 436501d87754ed61bc2d9f574b97be84c30a3f05)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r-- | src/gui/text/qtextdocument_p.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qtextdocument_p.h | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 7c4ca0abc23..9e630f37876 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -1419,6 +1419,16 @@ QTextFrame *QTextDocumentPrivate::rootFrame() const return rtFrame; } +void QTextDocumentPrivate::addCursor(QTextCursorPrivate *c) +{ + cursors.insert(c); +} + +void QTextDocumentPrivate::removeCursor(QTextCursorPrivate *c) +{ + cursors.remove(c); +} + QTextFrame *QTextDocumentPrivate::frameAt(int pos) const { QTextFrame *f = rootFrame(); diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index effcfcabed5..d77ee7420b2 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -243,8 +243,8 @@ private: public: void documentChange(int from, int length); - inline void addCursor(QTextCursorPrivate *c) { cursors.insert(c); } - inline void removeCursor(QTextCursorPrivate *c) { cursors.remove(c); } + void addCursor(QTextCursorPrivate *c); + void removeCursor(QTextCursorPrivate *c); QTextFrame *frameAt(int pos) const; QTextFrame *rootFrame() const; |