summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA/src/security.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mmap_SA/src/security.cpp')
-rw-r--r--plugins/Dbx_mmap_SA/src/security.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/plugins/Dbx_mmap_SA/src/security.cpp b/plugins/Dbx_mmap_SA/src/security.cpp
index 8b075a37a0..04d7c82b49 100644
--- a/plugins/Dbx_mmap_SA/src/security.cpp
+++ b/plugins/Dbx_mmap_SA/src/security.cpp
@@ -186,15 +186,9 @@ int SelectEncoder()
void CDbxMmapSA::EncodeAll()
{
- HANDLE hContact;
-
- hContact = db_find_first();
- if (hContact){
- do {
- EncodeContactEvents(hContact);
- EncodeContactSettings(hContact);
- }
- while(hContact = FindNextContact(hContact));
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ EncodeContactEvents(hContact);
+ EncodeContactSettings(hContact);
}
EncodeContactEvents(NULL);
@@ -203,14 +197,9 @@ void CDbxMmapSA::EncodeAll()
void CDbxMmapSA::DecodeAll()
{
- HANDLE hContact;
-
- hContact = db_find_first();
- if (hContact){
- do{
- DecodeContactEvents(hContact);
- DecodeContactSettings(hContact);
- }while(hContact = db_find_next(hContact));
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ DecodeContactEvents(hContact);
+ DecodeContactSettings(hContact);
}
DecodeContactEvents(NULL);
DecodeContactSettings(NULL);