summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbevents.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mdb/src/dbevents.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbevents.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp
index d890d86185..42ff027db8 100644
--- a/plugins/Dbx_mdb/src/dbevents.cpp
+++ b/plugins/Dbx_mdb/src/dbevents.cpp
@@ -271,18 +271,15 @@ void CDbxMdb::FindNextUnread(const txn_ptr &txn, DBCachedContact *cc, DBEventSor
MDB_val key = { sizeof(key2), &key2 }, data;
- if (mdb_cursor_get(cursor, &key, &data, MDB_SET) == MDB_SUCCESS)
+ for (int res = mdb_cursor_get(cursor, &key, &data, MDB_SET); res == MDB_SUCCESS; res = mdb_cursor_get(cursor, &key, &data, MDB_NEXT))
{
- while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS)
- {
- const DBEvent *dbe = (const DBEvent*)data.mv_data;
- if (dbe->contactID != cc->contactID)
- break;
- if (!dbe->markedRead()) {
- cc->dbc.dwFirstUnread = key2.dwEventId;
- cc->dbc.tsFirstUnread = key2.ts;
- return;
- }
+ const DBEvent *dbe = (const DBEvent*)data.mv_data;
+ if (dbe->contactID != cc->contactID)
+ break;
+ if (!dbe->markedRead()) {
+ cc->dbc.dwFirstUnread = key2.dwEventId;
+ cc->dbc.tsFirstUnread = key2.ts;
+ return;
}
}