Skip to content

Commit 2416c91

Browse files
committed
fix ci failure check
Signed-off-by: Harinath Nampally <[email protected]>
1 parent b68bd16 commit 2416c91

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

include/nlohmann/detail/json_pointer.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <nlohmann/detail/string_concat.hpp>
2727
#include <nlohmann/detail/string_escape.hpp>
2828
#include <nlohmann/detail/value_t.hpp>
29+
#include <string_view>
2930

3031
NLOHMANN_JSON_NAMESPACE_BEGIN
3132

@@ -750,9 +751,7 @@ class json_pointer
750751
// iterate array and use index as reference string
751752
for (std::size_t i = 0; i < value.m_data.m_value.array->size(); ++i)
752753
{
753-
// Convert std::string to string_t before passing to flatten
754-
auto concat_result = detail::concat(reference_string, '/', std::to_string(i));
755-
flatten(string_t(concat_result.c_str()),
754+
flatten(detail::concat<string_t>(reference_string, '/', std::to_string(i)),
756755
value.m_data.m_value.array->operator[](i), result);
757756
}
758757
}
@@ -771,9 +770,7 @@ class json_pointer
771770
// iterate object and use keys as reference string
772771
for (const auto& element : *value.m_data.m_value.object)
773772
{
774-
// Convert std::string to string_t before passing to flatten
775-
auto concat_result = detail::concat(reference_string, '/', detail::escape(element.first));
776-
flatten(string_t(concat_result.c_str()), element.second, result);
773+
flatten(detail::concat<string_t>(reference_string, '/', detail::escape(element.first)), element.second, result);
777774
}
778775
}
779776
break;

single_include/nlohmann/json.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14515,6 +14515,7 @@ NLOHMANN_JSON_NAMESPACE_END
1451514515

1451614516
// #include <nlohmann/detail/value_t.hpp>
1451714517

14518+
#include <string_view>
1451814519

1451914520
NLOHMANN_JSON_NAMESPACE_BEGIN
1452014521

@@ -15239,9 +15240,7 @@ class json_pointer
1523915240
// iterate array and use index as reference string
1524015241
for (std::size_t i = 0; i < value.m_data.m_value.array->size(); ++i)
1524115242
{
15242-
// Convert std::string to string_t before passing to flatten
15243-
auto concat_result = detail::concat(reference_string, '/', std::to_string(i));
15244-
flatten(string_t(concat_result.c_str()),
15243+
flatten(detail::concat<string_t>(reference_string, '/', std::to_string(i)),
1524515244
value.m_data.m_value.array->operator[](i), result);
1524615245
}
1524715246
}
@@ -15260,9 +15259,7 @@ class json_pointer
1526015259
// iterate object and use keys as reference string
1526115260
for (const auto& element : *value.m_data.m_value.object)
1526215261
{
15263-
// Convert std::string to string_t before passing to flatten
15264-
auto concat_result = detail::concat(reference_string, '/', detail::escape(element.first));
15265-
flatten(string_t(concat_result.c_str()), element.second, result);
15262+
flatten(detail::concat<string_t>(reference_string, '/', detail::escape(element.first)), element.second, result);
1526615263
}
1526715264
}
1526815265
break;

0 commit comments

Comments
 (0)