From b84699ae1bf51aeda1e41ca1ae53e83acd82150e Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 13 Jul 2014 17:08:31 +0200 Subject: 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 --- src/corelib/tools/qregularexpression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qregularexpression.cpp') diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 259cfaba7e..88ce4caea3 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -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; -- cgit v1.2.3