]> git.lyx.org Git - features.git/commitdiff
Slightly simplify code by using for range.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 27 Feb 2022 19:37:19 +0000 (20:37 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 27 Feb 2022 19:37:51 +0000 (20:37 +0100)
src/support/debug.cpp

index ca14220cfcb1997c547a05438123ced165c357c3..4e2b5c0375b63504b02f27a7da906547a20173bc 100644 (file)
@@ -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";
 }