QRegularExpression: make optimize() const
Although it may seem strange that such a method is const, optimizing doesn't affect the user-visible part of the object. Moreover, *not* having it const makes it asymmetrical with other methods (such as match()) which are const, and under certain conditions optimize as well. Change-Id: I0cd8d4a6909d00629fcc65c1c3a1f011f31db782 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
972a653a86
commit
b84699ae1b
|
|
@ -1731,7 +1731,7 @@ QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QString &s
|
|||
|
||||
\sa QRegularExpression::OptimizeOnFirstUsageOption
|
||||
*/
|
||||
void QRegularExpression::optimize()
|
||||
void QRegularExpression::optimize() const
|
||||
{
|
||||
if (!isValid()) // will compile the pattern
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public:
|
|||
MatchType matchType = NormalMatch,
|
||||
MatchOptions matchOptions = NoMatchOption) const;
|
||||
|
||||
void optimize();
|
||||
void optimize() const;
|
||||
|
||||
static QString escape(const QString &str);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue