Replace Q_UNUSED with [[maybe_unused]] attribute

PR #19471.
This commit is contained in:
Victor Chernyakin 2023-08-17 21:09:40 -07:00 committed by GitHub
parent f3f4610ba4
commit 34d30ed031
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 31 additions and 75 deletions

View file

@ -69,9 +69,8 @@ private slots:
{3, 'b'},
{4, 'd'}
};
Algorithm::removeIf(data, [](const int key, const char value)
Algorithm::removeIf(data, []([[maybe_unused]] const int key, const char value)
{
Q_UNUSED(key);
return (value == 'b');
});
QCOMPARE(data.size(), 3);
@ -83,9 +82,8 @@ private slots:
}
{
QHash<int, char> data;
Algorithm::removeIf(data, [](const int key, const char value)
Algorithm::removeIf(data, []([[maybe_unused]] const int key, const char value)
{
Q_UNUSED(key);
return (value == 'b');
});
QVERIFY(data.empty());