Reduce function call overhead
The arg() function of the QString class has a variable length argument which allows to reduce the number of chained calls to the same function. With proper formatting, readability is not affected.
This commit is contained in:
@@ -36,9 +36,9 @@ void CsvParserModel::setFilename(const QString& filename)
|
||||
QString CsvParserModel::getFileInfo()
|
||||
{
|
||||
QString a(tr("%1, %2, %3", "file info: bytes, rows, columns")
|
||||
.arg(tr("%n byte(s)", nullptr, getFileSize()))
|
||||
.arg(tr("%n row(s)", nullptr, getCsvRows()))
|
||||
.arg(tr("%n column(s)", nullptr, qMax(0, getCsvCols() - 1))));
|
||||
.arg(tr("%n byte(s)", nullptr, getFileSize()),
|
||||
tr("%n row(s)", nullptr, getCsvRows()),
|
||||
tr("%n column(s)", nullptr, qMax(0, getCsvCols() - 1))));
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user