Don't do any more iteration if we found the right index

This commit is contained in:
Luis Ángel San Martín 2022-10-25 07:48:39 +02:00
parent cea26ecc20
commit 02df90f3bd

View File

@ -237,6 +237,10 @@ QModelIndex FolderModel::index(qulonglong folderId) const
{
QModelIndex index;
iterate(QModelIndex(), this, [&](const QModelIndex &idx) {
if (index.isValid()) {
return false;
}
auto item = static_cast<FolderItem *>(idx.internalPointer());
if (item->id == folderId) {
index = idx;