Port QRegExp to QRegularExpression
ClosedPublic

Authored by ahmadsamir on Dec 24 2019, 2:07 PM.

Diff Detail

Repository
R246 Sonnet
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 24 2019, 2:07 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 24 2019, 2:07 PM
ahmadsamir requested review of this revision.Dec 24 2019, 2:07 PM
apol added a comment.Dec 24 2019, 4:21 PM

Looks good otherwise

data/parsetrigrams.cpp
44

capturedRef

ahmadsamir updated this revision to Diff 72149.Dec 24 2019, 4:27 PM

Use capturedRef(), cheaper

cullmann requested changes to this revision.Feb 29 2020, 8:33 PM

Actually, one can re-use this regex for all files by moving it before the scope of the loop, or?
The match on the other side is allocated per match() call, I would just move that inside the inner stuff and just do some
const auto match = rx....

This revision now requires changes to proceed.Feb 29 2020, 8:33 PM
ahmadsamir updated this revision to Diff 76705.Feb 29 2020, 9:03 PM
  • Move the QRegularExpression definition out of the for loop, more efficient as it'll reused
  • match() always allocates a QRegularExpressionMatch anyway, so move it inside the while loop
  • Make the first () non-capturing since the capture group isn't needed
cullmann accepted this revision.Mar 1 2020, 12:07 PM

Thanks, guess that should go in now.

This revision is now accepted and ready to land.Mar 1 2020, 12:07 PM
This revision was automatically updated to reflect the committed changes.