mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Don't do any more iteration if we found the right index
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user