mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
Fix fmt::replace_all with empty from and add unit tests
This commit is contained in:
parent
259768e896
commit
486e93f418
3 changed files with 223 additions and 1 deletions
|
@ -748,6 +748,12 @@ void fmt::raw_append(std::string& out, const char* fmt, const fmt_type_info* sup
|
|||
|
||||
std::string fmt::replace_all(std::string_view src, std::string_view from, std::string_view to, usz count)
|
||||
{
|
||||
if (src.empty())
|
||||
return {};
|
||||
|
||||
if (from.empty() || count == 0)
|
||||
return std::string(src);
|
||||
|
||||
std::string target;
|
||||
target.reserve(src.size() + to.size());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue