wip
This commit is contained in:
parent
1b0a89fbd0
commit
f0bb5faa6a
@ -16,8 +16,8 @@ using namespace osrm;
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
// we use std::string_view as a key in the object, so since here we have dynamic keys we have to "hold" them somewhere
|
// we use std::string_view as a key in the object, so since here we have dynamic keys we have to
|
||||||
// okay for tests...
|
// "hold" them somewhere okay for tests...
|
||||||
static std::unordered_set<std::string> gKeysHolder;
|
static std::unordered_set<std::string> gKeysHolder;
|
||||||
|
|
||||||
void convert(const rapidjson::Value &value, json::Value &result)
|
void convert(const rapidjson::Value &value, json::Value &result)
|
||||||
@ -38,7 +38,7 @@ void convert(const rapidjson::Value &value, json::Value &result)
|
|||||||
json::Value member;
|
json::Value member;
|
||||||
convert(itr->value, member);
|
convert(itr->value, member);
|
||||||
auto keyItr = gKeysHolder.emplace(itr->name.GetString()).first;
|
auto keyItr = gKeysHolder.emplace(itr->name.GetString()).first;
|
||||||
object.values.emplace(*keyItr, std::move(member));;
|
object.values.emplace(*keyItr, std::move(member));
|
||||||
}
|
}
|
||||||
result = std::move(object);
|
result = std::move(object);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user