]> git.lyx.org Git - lyx.git/commitdiff
Simplify a loop with a for-each.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Sat, 9 Mar 2024 19:46:54 +0000 (20:46 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sat, 9 Mar 2024 19:46:54 +0000 (20:46 +0100)
These loops were brought by C++11. The next step could be using std::any_of.

src/mathed/MathSupport.cpp

index 57e8c6ee4e4f7f5381a411e356ad1bea48f82b27..585320f11aea3d640d2a9cb1e7e5fc92fb28f0db 100644 (file)
@@ -1070,10 +1070,10 @@ bool isAlphaSymbol(MathAtom const & at)
 
        if (at->asFontInset()) {
                MathData const & ar = at->asFontInset()->cell(0);
-               for (size_t i = 0; i < ar.size(); ++i) {
-                       if (!(ar[i]->asCharInset() ||
-                             (ar[i]->asSymbolInset() &&
-                              ar[i]->asSymbolInset()->isOrdAlpha())))
+               for (const auto & i : ar) {
+                       if (!(i->asCharInset() ||
+                             (i->asSymbolInset() &&
+                              i->asSymbolInset()->isOrdAlpha())))
                                return false;
                }
                return true;