mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 10:36:39 +00:00
Avoid double lookup
This commit is contained in:
parent
2a50212f87
commit
8dd6b16fee
1 changed files with 8 additions and 8 deletions
|
@ -580,10 +580,10 @@ void ContentSelectorModel::ContentModel::sortFiles()
|
||||||
|
|
||||||
bool ContentSelectorModel::ContentModel::isChecked(const QString& filepath) const
|
bool ContentSelectorModel::ContentModel::isChecked(const QString& filepath) const
|
||||||
{
|
{
|
||||||
if (mCheckStates.contains(filepath))
|
const auto it = mCheckStates.find(filepath);
|
||||||
return (mCheckStates[filepath] == Qt::Checked);
|
if (it == mCheckStates.end())
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
return it.value() == Qt::Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentSelectorModel::ContentModel::isEnabled(const QModelIndex& index) const
|
bool ContentSelectorModel::ContentModel::isEnabled(const QModelIndex& index) const
|
||||||
|
@ -593,10 +593,10 @@ bool ContentSelectorModel::ContentModel::isEnabled(const QModelIndex& index) con
|
||||||
|
|
||||||
bool ContentSelectorModel::ContentModel::isNew(const QString& filepath) const
|
bool ContentSelectorModel::ContentModel::isNew(const QString& filepath) const
|
||||||
{
|
{
|
||||||
if (mNewFiles.contains(filepath))
|
const auto it = mNewFiles.find(filepath);
|
||||||
return mNewFiles[filepath];
|
if (it == mNewFiles.end())
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
return it.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentSelectorModel::ContentModel::setNew(const QString& filepath, bool isNew)
|
void ContentSelectorModel::ContentModel::setNew(const QString& filepath, bool isNew)
|
||||||
|
|
Loading…
Reference in a new issue