From kde-commits Mon Jul 02 13:33:30 2012 From: Dominik Haumann Date: Mon, 02 Jul 2012 13:33:30 +0000 To: kde-commits Subject: [kate] part/document: only call kateTextLine once: saves 75000 functions calls (in large files) Message-Id: <20120702133330.E59C8A60C6 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=134123624117077 Git commit f0b0f4f707395e49d362a2b5bbc27118a9210d20 by Dominik Haumann. Committed on 02/07/2012 at 14:33. Pushed by dhaumann into branch 'master'. only call kateTextLine once: saves 75000 functions calls (in large files) M +3 -2 part/document/katedocument.cpp http://commits.kde.org/kate/f0b0f4f707395e49d362a2b5bbc27118a9210d20 diff --git a/part/document/katedocument.cpp b/part/document/katedocument.cpp index 266564b..653c149 100644 --- a/part/document/katedocument.cpp +++ b/part/document/katedocument.cpp @@ -3728,10 +3728,11 @@ bool KateDocument::findMatchingBracket( KTextEditor= ::Range& range, int maxLines if (!cursor->move(searchDir)) return false; = - if (kateTextLine(cursor->line())->attribute(cursor->column()) =3D=3D v= alidAttr ) + Kate::TextLine textLine =3D kateTextLine(cursor->line()); + if (textLine->attribute(cursor->column()) =3D=3D validAttr ) { /* Check for match */ - QChar c =3D character(cursor->toCursor()); + QChar c =3D textLine->at(cursor->column()); if( c =3D=3D bracket ) { nesting++; } else if( c =3D=3D opposite ) {