From: Thibaut Cuvelier Date: Sun, 27 Feb 2022 19:37:19 +0000 (+0100) Subject: Slightly simplify code by using for range. X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=75be9b120001c1c072cc4330bc5cb0603d6c4dfb;p=features.git Slightly simplify code by using for range. --- diff --git a/src/support/debug.cpp b/src/support/debug.cpp index ca14220cfc..4e2b5c0375 100644 --- a/src/support/debug.cpp +++ b/src/support/debug.cpp @@ -98,9 +98,9 @@ Debug::Type Debug::value(int idx) string const Debug::description(Debug::Type val) { - for (int i = 0 ; i < numErrorTags ; ++i) { - if (errorTags[i].level == val) - return errorTags[i].desc; + for (const auto & errorTag : errorTags) { + if (errorTag.level == val) + return errorTag.desc; } return "unknown level"; } @@ -108,9 +108,9 @@ string const Debug::description(Debug::Type val) string const Debug::name(Debug::Type val) { - for (int i = 0 ; i < numErrorTags ; ++i) { - if (errorTags[i].level == val) - return errorTags[i].name; + for (const auto & errorTag : errorTags) { + if (errorTag.level == val) + return errorTag.name; } return "unknown level"; }