Skip to content

Fix off-by-one error in ItemRepository::index()

Not sure if the assertions added in the first commit are worth keeping. If they are useful, the assertion code in ItemRepository::index() could be shortened, as apparently ItemRepository::createIndex() does not modify m_currentBucket and m_buckets.size():

-            auto result = createIndex(...);
-            Q_ASSERT(m_currentBucket < m_buckets.size());
-            return result;
+            Q_ASSERT(m_currentBucket < m_buckets.size());
+            return createIndex(...);

See the commit messages for details.

Edited by Igor Kushnir

Merge request reports