diff options
author | Sergio Martins <smartins@kde.org> | 2016-01-16 01:03:50 +0000 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2016-01-16 01:03:50 +0000 |
commit | d36755d02d2306c13232c063d8b69a4320127463 (patch) | |
tree | f956832578d918cd9a246f0f622457af8b6ad921 /tests/reserve-candidates | |
parent | bb881036d8fa545f8c2101040fce2875d4aa876f (diff) |
reserve-candidates: Don't warn for while and do-while loops
Those loops result in a very big amount of false-positives, most
while loops I've seen in Qt and KDE can't use reserve.
Diffstat (limited to 'tests/reserve-candidates')
-rw-r--r-- | tests/reserve-candidates/main.cpp | 2 | ||||
-rw-r--r-- | tests/reserve-candidates/main.cpp.expected | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/tests/reserve-candidates/main.cpp b/tests/reserve-candidates/main.cpp index 759931b3..3edecbb0 100644 --- a/tests/reserve-candidates/main.cpp +++ b/tests/reserve-candidates/main.cpp @@ -214,7 +214,7 @@ void moreStuff() QHash<int,int> h; QHashIterator<int,int> it(h); - while (it.hasNext()) { // Warning + while (it.hasNext()) { // Ok v.push_back(1); } } diff --git a/tests/reserve-candidates/main.cpp.expected b/tests/reserve-candidates/main.cpp.expected index 703daa96..dbdd8f08 100644 --- a/tests/reserve-candidates/main.cpp.expected +++ b/tests/reserve-candidates/main.cpp.expected @@ -12,4 +12,3 @@ reserve-candidates/main.cpp:172:9: warning: Reserve candidate [-Wclazy-reserve-c reserve-candidates/main.cpp:175:9: warning: Reserve candidate [-Wclazy-reserve-candidates] reserve-candidates/main.cpp:182:9: warning: Reserve candidate [-Wclazy-reserve-candidates] reserve-candidates/main.cpp:183:9: warning: Reserve candidate [-Wclazy-reserve-candidates] -reserve-candidates/main.cpp:218:9: warning: Reserve candidate [-Wclazy-reserve-candidates] |