CPlusPlus: Microoptimizations

Inline some simple accessors, return references instead of copies in
some getters,

Change-Id: I136574823c79ad0c63ed354b78e1ad83908e7ae5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-08-10 09:41:42 +02:00
parent f9ce879b61
commit 0197a62fcf
13 changed files with 36 additions and 98 deletions

View File

@@ -658,8 +658,7 @@ bool FromGuiFunctor::matchIncludeFile(const Document::Ptr &document, int line)
bool FromGuiFunctor::matchMacroInUse(const Document::Ptr &document, int pos)
{
const QList<Document::MacroUse> macros = document->macroUses();
for (const Document::MacroUse &use : macros) {
for (const Document::MacroUse &use : document->macroUses()) {
if (use.containsUtf16charOffset(pos)) {
const int begin = use.utf16charsBegin();
if (pos < begin + use.macro().nameToQString().size()) {