mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Pass std::string_view by value, fix dangling reference in ServerHandler
Agent-Logs-Url: https://github.com/XRPLF/rippled/sessions/3aef40d0-f51b-484c-a5d3-43dd37d6187f Co-authored-by: mvadari <8029314+mvadari@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
40a5871c41
commit
243ca1bdec
@@ -182,7 +182,7 @@ split_commas(FwdIt first, FwdIt last)
|
||||
|
||||
template <class Result = std::vector<std::string>>
|
||||
Result
|
||||
split_commas(std::string_view const& s)
|
||||
split_commas(std::string_view s)
|
||||
{
|
||||
return split_commas(s.begin(), s.end());
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ namespace Json {
|
||||
|
||||
class Value;
|
||||
|
||||
using Output = std::function<void(std::string_view const&)>;
|
||||
using Output = std::function<void(std::string_view)>;
|
||||
|
||||
inline Output
|
||||
stringOutput(std::string& s)
|
||||
{
|
||||
return [&](std::string_view const& b) { s.append(b.data(), b.size()); };
|
||||
return [&](std::string_view b) { s.append(b.data(), b.size()); };
|
||||
}
|
||||
|
||||
/** Writes a minimal representation of a Json value to an Output in O(n) time.
|
||||
|
||||
Reference in New Issue
Block a user