mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Don't do any more iteration if we found the right index
This commit is contained in:
parent
cea26ecc20
commit
02df90f3bd
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user