1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

filter: use std::move() to pass around std::string

Suggested by Coverity. Seems like a good idea.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-08-13 23:31:36 +02:00 committed by Michael Keller
parent 455bc8f40c
commit 1dade48aa6

View file

@ -38,13 +38,13 @@ static int filter_preset_add_to_table(const std::string name, const FilterData &
void filter_preset_table::add(const filter_preset &preset)
{
std::string name = get_unique_preset_name(preset.name, *this);
filter_preset_add_to_table(name, preset.data, *this);
filter_preset_add_to_table(std::move(name), preset.data, *this);
}
int filter_preset_table::add(const std::string &nameIn, const FilterData &d)
{
std::string name = get_unique_preset_name(nameIn, *this);
return filter_preset_add_to_table(name, d, *this);
return filter_preset_add_to_table(std::move(name), d, *this);
}
void filter_preset_table::remove(int preset)