Small performance improvements suggested by clang-tidy
ClosedPublic

Authored by aacid on Oct 3 2019, 9:55 PM.

Details

Summary

As far as i can see none of the modified .h files is actually public so
that shouldn't be a BC problem

Diff Detail

Repository
R39 KTextEditor
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17310
Build 17328: arc lint + arc unit
aacid created this revision.Oct 3 2019, 9:55 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptOct 3 2019, 9:55 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
aacid requested review of this revision.Oct 3 2019, 9:55 PM
aacid planned changes to this revision.Oct 4 2019, 8:30 AM
aacid added inline comments.
src/vimode/modes/modebase.cpp
333

This is wrong, QRegExp is broken and lastIndexIn modifies the object even if the function is marked as const

cullmann accepted this revision.Oct 4 2019, 6:48 PM
cullmann added a subscriber: cullmann.

I think this is ok to merge, I don't see the issue with the QRegExp. (I understand that it stores it result in mutable data in the object, but that patch didn't alter this, just avoids the copying of the regex before this happens, or do I misread the diff?)

src/vimode/modes/modebase.cpp
333

Hmm, given that is a local var on the stack, I don't see an issue with this.
This would only be problematic with some static var, or?

dhaumann accepted this revision.Oct 4 2019, 9:31 PM
dhaumann added a subscriber: dhaumann.

I also think it's fine. A next patch could convert the QRegExp to a QRegularExpression.

aacid requested review of this revision.Oct 4 2019, 9:49 PM

Ok, i'll commit it then :)

src/vimode/modes/modebase.cpp
333

right is a local var ^_^ i got confused by a similar-ish patch in qtbase where the qregexp was passed in.

This revision is now accepted and ready to land.Oct 4 2019, 9:49 PM
aacid closed this revision.Oct 4 2019, 9:56 PM