db/Interface: remove IsPlugin(), use dynamic_cast instead

This commit is contained in:
Max Kellermann
2018-11-19 19:19:20 +01:00
parent ed9ece5ea3
commit bda77ffc5b
5 changed files with 15 additions and 30 deletions

View File

@@ -106,10 +106,9 @@ storage_state_restore(const char *line, TextFile &file, Instance &instance)
return true;
}
Database *db = instance.database;
if (db != nullptr && db->IsPlugin(simple_db_plugin)) {
if (auto *db = dynamic_cast<SimpleDatabase *>(instance.database)) {
try {
((SimpleDatabase *)db)->Mount(uri.c_str(), url.c_str());
db->Mount(uri.c_str(), url.c_str());
} catch (...) {
FormatError(std::current_exception(),
"Failed to restore mount to %s",