QTranslator: simplify code

By using std::max.

Change-Id: I3a859fa3fa547449a952ab0d4c39bd8c2779a2c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2024-10-10 16:23:04 +03:00
parent 4754f0611d
commit b429da48be

View File

@ -478,11 +478,8 @@ bool QTranslator::load(const QString & filename, const QString & directory,
break;
qsizetype rightmost = 0;
for (auto ch : delims) {
qsizetype k = fname.lastIndexOf(ch);
if (k > rightmost)
rightmost = k;
}
for (auto ch : delims)
rightmost = std::max(rightmost, fname.lastIndexOf(ch));
// no truncations? fail
if (rightmost == 0)