QRegularExpression: const correctness fixes
authorGiuseppe D'Angelo <dangelog@gmail.com>
Sun, 19 Feb 2012 22:58:04 +0000 (23:58 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 6 Mar 2012 22:56:55 +0000 (23:56 +0100)
Adding some const qualifiers to members which are never written.

Change-Id: Ibb8953764c7b7790a419a5d48f2956751d5fc1f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qregularexpression.cpp

index 7bbac01..40b6b5a 100644 (file)
@@ -817,14 +817,14 @@ struct QRegularExpressionMatchPrivate : QSharedData
 
     QRegularExpressionMatch nextMatch() const;
 
-    QRegularExpression regularExpression;
-    QString subject;
+    const QRegularExpression regularExpression;
+    const QString subject;
     // the capturedOffsets vector contains pairs of (start, end) positions
     // for each captured substring
     QVector<int> capturedOffsets;
 
-    QRegularExpression::MatchType matchType;
-    QRegularExpression::MatchOptions matchOptions;
+    const QRegularExpression::MatchType matchType;
+    const QRegularExpression::MatchOptions matchOptions;
 
     int capturedCount;
 
@@ -835,16 +835,16 @@ struct QRegularExpressionMatchPrivate : QSharedData
 
 struct QRegularExpressionMatchIteratorPrivate : QSharedData
 {
-    QRegularExpressionMatchIteratorPrivate(const QRegularExpression re,
+    QRegularExpressionMatchIteratorPrivate(const QRegularExpression &re,
                                            QRegularExpression::MatchType matchType,
                                            QRegularExpression::MatchOptions matchOptions,
                                            const QRegularExpressionMatch &next);
 
     bool hasNext() const;
     QRegularExpressionMatch next;
-    QRegularExpression regularExpression;
-    QRegularExpression::MatchType matchType;
-    QRegularExpression::MatchOptions matchOptions;
+    const QRegularExpression regularExpression;
+    const QRegularExpression::MatchType matchType;
+    const QRegularExpression::MatchOptions matchOptions;
 };
 
 /*!
@@ -1216,7 +1216,7 @@ QRegularExpressionMatch QRegularExpressionMatchPrivate::nextMatch() const
 /*!
     \internal
 */
-QRegularExpressionMatchIteratorPrivate::QRegularExpressionMatchIteratorPrivate(const QRegularExpression re,
+QRegularExpressionMatchIteratorPrivate::QRegularExpressionMatchIteratorPrivate(const QRegularExpression &re,
                                                                                QRegularExpression::MatchType matchType,
                                                                                QRegularExpression::MatchOptions matchOptions,
                                                                                const QRegularExpressionMatch &next)