From e78fdc72550e93e39855f6e271709356f3d9c1f9 Mon Sep 17 00:00:00 2001 From: yuzhang Date: Mon, 29 Aug 2022 22:12:48 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E4=BF=9D=E8=AF=81json=20field=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/data_layer.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/data_layer.hpp b/src/util/data_layer.hpp index de5674dd..5b30ff4a 100644 --- a/src/util/data_layer.hpp +++ b/src/util/data_layer.hpp @@ -999,10 +999,10 @@ public: root["index_type"] = std::move(get_index_type_string()); root["index_value"] = std::move(get_index_value_string()); root["values"] = Json::Value(Json::ValueType::arrayValue); - for (auto &[name, ptr] : field_map_) { + for (auto &ptr : field_vec_) { if (ptr->is_dirty()) { Json::Value value; - value["name"] = name; + value["name"] = ptr->get_name(); value["value"] = std::move(ptr->to_json()); value["type"] = ptr->get_type(); root["values"].append(std::move(value)); @@ -1045,9 +1045,9 @@ public: root["index_type"] = std::move(get_index_type_string()); root["index_value"] = std::move(get_index_value_string()); root["values"] = Json::Value(Json::ValueType::arrayValue); - for (auto &[name, ptr] : field_map_) { + for (auto &ptr : field_vec_) { Json::Value value; - value["name"] = name; + value["name"] = ptr->get_name(); value["value"] = std::move(ptr->to_json()); value["type"] = ptr->get_type(); root["values"].append(std::move(value)); -- Gitee