forked from qt-creator/qt-creator
Don't allocate unneeded temporary containers
Fix clazy warnings: allocating an unneeded temporary container [clazy-container-anti-pattern] Change-Id: I4b4c2c634eea650bbdf3c12d982a17f899fc94ec Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -83,7 +83,9 @@ QVariant CtfStatisticsModel::data(const QModelIndex &index, int role) const
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
QString title = m_data.keys().at(index.row());
|
||||
auto it = m_data.cbegin();
|
||||
std::advance(it, index.row());
|
||||
const QString &title = it.key();
|
||||
|
||||
switch (role) {
|
||||
case Qt::TextAlignmentRole:
|
||||
|
||||
Reference in New Issue
Block a user