Skip to content

Commit

Permalink
Fixed issue with the RapidJSON benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzicheng1987 committed Jun 1, 2024
1 parent 89a9397 commit 436c9fe
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions benchmarks/json/simple_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,9 @@ std::vector<Person> rapidjson_to_children(const rapidjson::Value &_arr) {

Person rapidjson_to_person(const rapidjson::Value &_val) {
Person person;
for (auto &m : _val.GetObject()) {
if (m.name == "first_name") {
person.first_name = _val["first_name"].GetString();
} else if (m.name == "last_name") {
person.last_name = _val["last_name"].GetString();
} else if (m.name == "children") {
person.children = rapidjson_to_children(_val["children"].GetArray());
}
}
person.first_name = _val["first_name"].GetString();
person.last_name = _val["last_name"].GetString();
person.children = rapidjson_to_children(_val["children"].GetObject());
return person;
}

Expand Down

0 comments on commit 436c9fe

Please sign in to comment.