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.

Pick-to: 6.5
Task-number: QTBUG-97601
Change-Id: I37b920a8b364861efab78f736d71642dc82d8982
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2022-12-26 22:46:41 +01:00
parent e5a7487c62
commit 436501d877
2 changed files with 12 additions and 2 deletions

View File

@ -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();

View File

@ -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;