QTranslator: simplify code
By using std::max. Change-Id: I3a859fa3fa547449a952ab0d4c39bd8c2779a2c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
4754f0611d
commit
b429da48be
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user