From 82b07f1a3cc29b9785c292174343b464a774a722 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 28 Dec 2021 20:45:45 +0900 Subject: Code improvements based on c++11 standard (ranged for loops and nullptr). Signed-off-by: Michele Calgaro --- tests/test_auth_enum_actions.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/test_auth_enum_actions.cpp') diff --git a/tests/test_auth_enum_actions.cpp b/tests/test_auth_enum_actions.cpp index d7c992a97..8a9030ff7 100644 --- a/tests/test_auth_enum_actions.cpp +++ b/tests/test_auth_enum_actions.cpp @@ -27,12 +27,11 @@ int main(void) } // Check whether enumerateAction returns at least example actions int count = 0; - ActionDescription::List::const_iterator adIt; - for (adIt = list.begin(); adIt != list.end(); ++adIt) + for (const ActionDescription &actionDesc : list) { - if (((*adIt).actionId() == "org.tqt.policykit.examples.kick") || - ((*adIt).actionId() == "org.tqt.policykit.examples.cry") || - ((*adIt).actionId() == "org.tqt.policykit.examples.bleed")) + if ((actionDesc.actionId() == "org.tqt.policykit.examples.kick") || + (actionDesc.actionId() == "org.tqt.policykit.examples.cry") || + (actionDesc.actionId() == "org.tqt.policykit.examples.bleed")) { count++; } -- cgit v1.2.1