summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbevents.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-04-24 13:40:50 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-04-24 13:40:50 +0000
commitc831d41181f53d00debc5c725459f90ce25716f2 (patch)
tree2f763de6a0c6890653c1b7fe838e4976d7ad2bc8 /plugins/Dbx_mdb/src/dbevents.cpp
parent0080cd035eaa00062b5f0f494be1e8862d8548b7 (diff)
dbx_lmdb: updated lmdb engine
git-svn-id: http://svn.miranda-ng.org/main/trunk@16761 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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;
}
}