From a2b24cb5a2d6dadd6893ecc013defc11dc51fee2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 24 Jul 2018 22:09:29 +0200 Subject: [PATCH] SongFilter: pass std::string&& to Item constructor --- src/SongFilter.cxx | 4 ++-- src/SongFilter.hxx | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/SongFilter.cxx b/src/SongFilter.cxx index 2ca247e2b..cd8b9afd3 100644 --- a/src/SongFilter.cxx +++ b/src/SongFilter.cxx @@ -60,9 +60,9 @@ locate_parse_type(const char *str) noexcept return tag_name_parse_i(str); } -SongFilter::Item::Item(unsigned _tag, const char *_value, bool _fold_case) +SongFilter::Item::Item(unsigned _tag, std::string &&_value, bool _fold_case) :tag(_tag), - value(_value), + value(std::move(_value)), fold_case(_fold_case ? IcuCompare(value.c_str()) : IcuCompare()) { } diff --git a/src/SongFilter.hxx b/src/SongFilter.hxx index f4f47ec48..8c1008f7d 100644 --- a/src/SongFilter.hxx +++ b/src/SongFilter.hxx @@ -67,8 +67,7 @@ public: std::chrono::system_clock::time_point time; public: - gcc_nonnull(3) - Item(unsigned tag, const char *value, bool fold_case=false); + Item(unsigned tag, std::string &&_value, bool fold_case=false); Item(unsigned tag, std::chrono::system_clock::time_point time); unsigned GetTag() const {