From: Thibaut Cuvelier Date: Sat, 9 Mar 2024 19:46:54 +0000 (+0100) Subject: Simplify a loop with a for-each. X-Git-Tag: 2.4.0~116 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1b11dfeca5c4e11585129221d966e84c5c775402;p=lyx.git Simplify a loop with a for-each. These loops were brought by C++11. The next step could be using std::any_of. --- diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 57e8c6ee4e..585320f11a 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -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;