summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-04-13 11:22:07 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-04-13 11:22:07 +0300
commit9fd2b766b2e4487bde13755522a6972415b5b0d6 (patch)
tree395ae55c2a65f2e1a013961e7248910eec210167 /plugins
parent3c6c43a4e6d581f148b38755e22f63d9dd345de6 (diff)
code cleaning
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp28
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.h13
2 files changed, 16 insertions, 25 deletions
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp
index 5fbfdf1f69..73cd10b497 100644
--- a/plugins/Dbx_mdbx/src/dbintf.cpp
+++ b/plugins/Dbx_mdbx/src/dbintf.cpp
@@ -334,29 +334,13 @@ void CDbxMDBX::TouchFile()
///////////////////////////////////////////////////////////////////////////////
// MIDatabaseChecker
-typedef int (CDbxMDBX::*CheckWorker)(void);
-
-int CDbxMDBX::Start(DBCHeckCallback *callback)
-{
- cb = callback;
- return ERROR_SUCCESS;
-}
-
-static CheckWorker Workers[] =
-{
- &CDbxMDBX::CheckEvents1,
- &CDbxMDBX::CheckEvents2,
- &CDbxMDBX::CheckEvents3,
-};
-
int CDbxMDBX::CheckDb(int phase)
{
- if (phase >= _countof(Workers))
- return ERROR_OUT_OF_PAPER;
-
- return (this->*Workers[phase])();
-}
+ switch (phase) {
+ case 0: return CDbxMDBX::CheckEvents1();
+ case 1: return CDbxMDBX::CheckEvents2();
+ case 2: return CDbxMDBX::CheckEvents3();
+ }
-void CDbxMDBX::Destroy()
-{
+ return ERROR_OUT_OF_PAPER;
}
diff --git a/plugins/Dbx_mdbx/src/dbintf.h b/plugins/Dbx_mdbx/src/dbintf.h
index 4b6aac5804..25469bc606 100644
--- a/plugins/Dbx_mdbx/src/dbintf.h
+++ b/plugins/Dbx_mdbx/src/dbintf.h
@@ -296,9 +296,16 @@ protected:
return this;
}
- STDMETHODIMP_(BOOL) Start(DBCHeckCallback *callback);
- STDMETHODIMP_(BOOL) CheckDb(int phase);
- STDMETHODIMP_(VOID) Destroy();
+ STDMETHODIMP_(BOOL) Start(DBCHeckCallback *callback)
+ {
+ cb = callback;
+ return ERROR_SUCCESS;
+ }
+
+ STDMETHODIMP_(VOID) Destroy()
+ {}
+
+ STDMETHODIMP_(BOOL) CheckDb(int phase);
DBCHeckCallback *cb;
};