Mercurial > hg > orthanc-databases
diff MySQL/Plugins/MySQLIndex.cpp @ 199:8cae98f73d53
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 18 Mar 2021 14:52:06 +0100 |
parents | 3236894320d6 |
children | 42990b2dd51b |
line wrap: on
line diff
--- a/MySQL/Plugins/MySQLIndex.cpp Thu Mar 18 12:24:28 2021 +0100 +++ b/MySQL/Plugins/MySQLIndex.cpp Thu Mar 18 14:52:06 2021 +0100 @@ -49,14 +49,10 @@ IDatabase* MySQLIndex::OpenInternal() { uint32_t expectedVersion = 6; - if (context_) + + if (GetContext()) // "GetContext()" can possibly be NULL in the unit tests { - expectedVersion = OrthancPluginGetExpectedDatabaseVersion(context_); - } - else - { - // This case only occurs during unit testing - expectedVersion = 6; + expectedVersion = OrthancPluginGetExpectedDatabaseVersion(GetContext()); } // Check the expected version of the database @@ -273,7 +269,6 @@ MySQLIndex::MySQLIndex(const MySQLParameters& parameters) : IndexBackend(new Factory(*this)), - context_(NULL), parameters_(parameters), clearAll_(false) {