From 413a0a433135e2be11e4cf0ba9450f1d60dbc2b4 Mon Sep 17 00:00:00 2001 From: Keita Iwabuchi Date: Sat, 3 Sep 2022 08:38:54 -0700 Subject: [PATCH] Bugfix: Boost JSON string comparison --- include/metall/container/experimental/json/value.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/metall/container/experimental/json/value.hpp b/include/metall/container/experimental/json/value.hpp index eb119dec..4cb5a7e2 100644 --- a/include/metall/container/experimental/json/value.hpp +++ b/include/metall/container/experimental/json/value.hpp @@ -52,7 +52,10 @@ inline bool general_value_equal(const value &value, const other_ } else if (other_value.is_array()) { return value.is_array() && (value.as_array() == other_value.as_array()); } else if (other_value.is_string()) { - return value.is_string() && (value.as_string() == other_value.as_string()); + if (!value.is_string()) return false; + const auto& str = value.as_string(); + const auto& other_srt = other_value.as_string(); + return str.compare(other_srt.c_str()) == 0; } assert(false);