mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Introduce std::string_view
into wider use (#14368)
This commit is contained in:
parent
fa47af737f
commit
6ca214fefc
74 changed files with 501 additions and 456 deletions
|
@ -49,10 +49,10 @@ static void sanitize_string(std::string &str)
|
|||
str.erase(std::remove(str.begin(), str.end(), DESERIALIZE_PAIR_DELIM), str.end());
|
||||
}
|
||||
|
||||
bool ItemStackMetadata::setString(const std::string &name, const std::string &var)
|
||||
bool ItemStackMetadata::setString(const std::string &name, std::string_view var)
|
||||
{
|
||||
std::string clean_name = name;
|
||||
std::string clean_var = var;
|
||||
std::string clean_var(var);
|
||||
sanitize_string(clean_name);
|
||||
sanitize_string(clean_var);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue