diff --git a/code/espurna/migrate.cpp b/code/espurna/migrate.cpp index 984e625f..0e392274 100644 --- a/code/espurna/migrate.cpp +++ b/code/espurna/migrate.cpp @@ -13,14 +13,14 @@ Copyright (C) 2016-2019 by Xose PĂ©rez namespace { -void delPrefixes(const char** prefixes, size_t size) { +void delPrefixes(const std::initializer_list& prefixes) { std::vector to_purge; using namespace settings; kv_store.foreach([&](kvs_type::KeyValueResult&& kv) { auto key = kv.key.read(); - for (size_t index = 0; index < size; ++index) { - if (key.startsWith(prefixes[index])) { + for (const auto* prefix : prefixes) { + if (key.startsWith(prefix)) { to_purge.push_back(std::move(key)); return; } @@ -32,11 +32,6 @@ void delPrefixes(const char** prefixes, size_t size) { } } -template -void delPrefixes(const char* (&&prefixes)[Size]) { - delPrefixes(prefixes, Size); -} - } // namespace // Configuration versions