From e21f2314423f7752f0571c5475f0026ed7176f76 Mon Sep 17 00:00:00 2001 From: "xiaolei.zl" Date: Thu, 19 Dec 2024 12:02:15 +0800 Subject: [PATCH] fix order Committed-by: xiaolei.zl from Dev container --- flex/utils/yaml_utils.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flex/utils/yaml_utils.cc b/flex/utils/yaml_utils.cc index 775c4245ea2a..3c36a0e85535 100644 --- a/flex/utils/yaml_utils.cc +++ b/flex/utils/yaml_utils.cc @@ -52,12 +52,20 @@ void convert_yaml_node_to_json(const YAML::Node& node, json.SetInt(node.as()); } catch (const YAML::BadConversion& e) { try { - json.SetDouble(node.as()); + json.SetInt64(node.as()); } catch (const YAML::BadConversion& e) { try { - json.SetBool(node.as()); + json.SetUint64(node.as()); } catch (const YAML::BadConversion& e) { - json.SetString(node.as().c_str(), allocator); + try { + json.SetDouble(node.as()); + } catch (const YAML::BadConversion& e) { + try { + json.SetBool(node.as()); + } catch (const YAML::BadConversion& e) { + json.SetString(node.as().c_str(), allocator); + } + } } } }