Skip to content

Commit 4f012f9

Browse files
remove redundancy from output
1 parent 5351ac6 commit 4f012f9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/SHM_Format.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ SHM_Format::SHM_Format(const std::string &shm_name, const std::string &config_fi
2323
nlohmann::json SHM_Format::execute() const {
2424
nlohmann::json result;
2525

26-
auto &data_list = result["data"];
26+
nlohmann::json data_list = nlohmann::json::array();
2727
for (auto &a : shm_data) {
28-
auto data = a->get_data();
29-
data_list[data["name"].get<std::string>()] = data;
28+
data_list += a->get_data();
3029
}
3130

31+
result["data"] = data_list;
32+
3233
nlohmann::json shm_json;
3334
shm_json["name"] = shared_memory->get_name();
3435
shm_json["size"] = shared_memory->get_size();

0 commit comments

Comments
 (0)