Use a QMap instead of a QHash for the regexp flags
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 20 Apr 2012 11:59:30 +0000 (13:59 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 20 Apr 2012 13:49:33 +0000 (15:49 +0200)
This is unit-tested, so we need a predictable order. Therefore, we
can't use QHash anymore. Besides, this is just for 4 elements, so
there shouldn't be a perceptible overhead.

Change-Id: I878f77982e8070f3bc30bd2458e26e61b22f313d
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
src/xmlpatterns/functions/qpatternplatform.cpp
tests/auto/xmlpatterns/stderrBaselines/PrintalistofavailableregexpflagsTheavailableflagsareformattedinacomplexway..txt

index 91d3748..08dc2f1 100644 (file)
@@ -64,7 +64,7 @@ namespace QPatternist
     class PatternFlag
     {
     public:
-        typedef QHash<QChar, PatternFlag> Hash;
+        typedef QMap<QChar, PatternFlag> Hash;
 
         inline PatternFlag() : flag(PatternPlatform::NoFlags)
         {
index 9f09298..ff54402 100644 (file)
@@ -1,5 +1,5 @@
 Error FORX0001 in file:///home/fenglich/dev/qt-xslt/tests/auto/xmlpatterns/queries/invalidRegexpFlag.xq, at line 1, column 1: I is an invalid flag for regular expressions. Valid flags are:
-x - Whitespace characters are removed, except when they appear in character classes
 i - Matches are case insensitive
 m - ^ and $ match the start and end of a line.
 s - . matches newline characters
+x - Whitespace characters are removed, except when they appear in character classes