Skip to content

Commit 38d3c3e

Browse files
committed
WIP
1 parent 77aeb76 commit 38d3c3e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/icingadb/icingadb-objects.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,15 @@ void IcingaDB::UpdateAllConfigObjects()
402402
upqObjectType.Enqueue([&]() {
403403
for (auto& hMSet : source.second) {
404404
for (decltype(hMSet.size()) i = 0, stop = hMSet.size() - 1u; i < stop; i += 2u) {
405-
dest.emplace(std::move(hMSet[i]), std::move(hMSet[i + 1u]));
405+
auto variantToString = [](std::variant<const char*, String> v) {
406+
if (auto str (std::get_if<String>(&v)); str) {
407+
return std::move(*str);
408+
}
409+
410+
return std::get<const char*>(v);
411+
};
412+
413+
dest.emplace(variantToString(std::move(hMSet[i])), variantToString(std::move(hMSet[i + 1u])));
406414
}
407415

408416
hMSet.clear();

0 commit comments

Comments
 (0)