[KURISearchFilterEngine] Port QRegExp to QRegularExpression
ClosedPublic

Authored by ahmadsamir on Dec 31 2019, 2:57 PM.

Details

Summary

Use const as need be.
Use QList::at() where possible.

Test Plan

make && ctest

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Dec 31 2019, 2:57 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 31 2019, 2:57 PM
ahmadsamir requested review of this revision.Dec 31 2019, 2:57 PM
dfaure requested changes to this revision.Jan 1 2020, 10:20 AM
dfaure added inline comments.
src/urifilters/ikws/kuriikwsfiltereng.cpp
144

declare where first used (2 lines down)

149

Are you sure about the += here?
The old code had '=' and I don't understand the +=, given that capturedStart(0) is an absolute position in userquery, just like start.

150

this kind of duplicates line 142. Would it be more readable to do like you did in some other places, like

while ((match = qsexpr.match(userquery, start)).hasMatch())

?

245

declare where first used

319

same comment as above

320

same comment as above

This revision now requires changes to proceed.Jan 1 2020, 10:20 AM
ahmadsamir updated this revision to Diff 72528.Jan 1 2020, 1:15 PM

Address comments:
Search offset can't be +=, since the position is moves with capturedStart().
More compact code, always declare where used (don't micro-optimise?)

This revision is now accepted and ready to land.Jan 1 2020, 5:50 PM

This is also covered by kurifiltertest.

This revision was automatically updated to reflect the committed changes.