diff --git a/include/rfl/json/Reader.hpp b/include/rfl/json/Reader.hpp index c3096789..1e43f489 100644 --- a/include/rfl/json/Reader.hpp +++ b/include/rfl/json/Reader.hpp @@ -113,7 +113,7 @@ struct Reader { yyjson_val* key; while ((key = yyjson_obj_iter_next(&iter))) { const char* k = yyjson_get_str(key); - const auto it = _field_indices.find(std::string_view(k, strlen(k))); + const auto it = _field_indices.find(std::string_view(k)); if (it != _field_indices.end()) { f_arr[it->second] = InputVarType(yyjson_obj_iter_get_val(key)); } @@ -121,17 +121,16 @@ struct Reader { return f_arr; } - std::map to_map( + std::vector> to_map( InputObjectType* _obj) const noexcept { - std::map m; + std::vector> m; yyjson_obj_iter iter; yyjson_obj_iter_init(_obj->val_, &iter); yyjson_val* key; while ((key = yyjson_obj_iter_next(&iter))) { - const auto p = - std::make_pair(yyjson_get_str(key), - InputVarType(yyjson_obj_iter_get_val(key))); - m.emplace(std::move(p)); + auto p = std::make_pair(yyjson_get_str(key), + InputVarType(yyjson_obj_iter_get_val(key))); + m.emplace_back(std::move(p)); } return m; }