Browse Source

settings: fix gcc-4.8.2 builds

mcspr-patch-1
Maxim Prokhorov 3 years ago
parent
commit
c9a951068b
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      code/espurna/migrate.cpp

+ 3
- 8
code/espurna/migrate.cpp View File

@ -13,14 +13,14 @@ Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
namespace {
void delPrefixes(const char** prefixes, size_t size) {
void delPrefixes(const std::initializer_list<const char*>& prefixes) {
std::vector<String> 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 <size_t Size>
void delPrefixes(const char* (&&prefixes)[Size]) {
delPrefixes(prefixes, Size);
}
} // namespace
// Configuration versions


Loading…
Cancel
Save