summaryrefslogtreecommitdiffstats
path: root/src/tools/qlalr/compress.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-25 12:20:01 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-01-26 11:21:43 +0000
commit956021dbfcecfdcab0c8f72deca68d731be79898 (patch)
tree0cebbf89f468e25b98cea7fe55ac8f56c64e9b00 /src/tools/qlalr/compress.cpp
parentcf9d112d7a99502b7f68c3bce5fe5e2a6d123917 (diff)
qlalr: eradicate all Q_FOREACH loops
... by replacing them with C++11 range-for, or, for loops over .values(), with explicit iterator loops over the result of equal_range(). Some fixes here and there to get to mark containers const for iteration, without having to resort to qAsConst(). Didn't work everywhere. Change-Id: Ibc0e71d3b208d118f06e16741af47261ef4b9e15 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/tools/qlalr/compress.cpp')
-rw-r--r--src/tools/qlalr/compress.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/qlalr/compress.cpp b/src/tools/qlalr/compress.cpp
index 54ed053bf0..a486e68c4a 100644
--- a/src/tools/qlalr/compress.cpp
+++ b/src/tools/qlalr/compress.cpp
@@ -166,7 +166,7 @@ void Compress::operator () (int *table, int row_count, int column_count)
#ifndef QLALR_NO_CHECK_SORTED_TABLE
int previous_zeros = INT_MAX;
- foreach (UncompressedRow row, sortedTable)
+ for (const UncompressedRow &row : qAsConst(sortedTable))
{
int zeros = row.count (0);
@@ -178,7 +178,7 @@ void Compress::operator () (int *table, int row_count, int column_count)
index.fill (-999999, row_count);
- foreach (const UncompressedRow &row, sortedTable)
+ for (const UncompressedRow &row : qAsConst(sortedTable))
{
int first_token = std::distance (row.begin (), row.beginNonZeros ());
QVector<int>::iterator pos = info.begin ();
@@ -252,7 +252,7 @@ void Compress::operator () (int *table, int row_count, int column_count)
}
#if 0
- foreach (UncompressedRow row, sortedTable)
+ for (const UncompressedRow &row : qAsConst(sortedTable))
{
int i = row.index ();
Q_ASSERT (i < sortedTable.size ());