diff --git a/sources/Parser.h b/sources/Parser.h index a72cc930..9462d2f1 100644 --- a/sources/Parser.h +++ b/sources/Parser.h @@ -27,7 +27,7 @@ public: void disableRecursiveIncludeGuard() { recursiveIncludeGuard = false; } void enableRecursiveIncludeGuard() { recursiveIncludeGuard = true; } protected: - virtual void callback(std::string_view header, std::vector members) = 0; + virtual void callback(std::string_view header, const std::vector& members) = 0; std::filesystem::path rootDirectory { std::filesystem::current_path() }; private: bool recursiveIncludeGuard { false }; diff --git a/sources/ParserMain.cpp b/sources/ParserMain.cpp index 990487c5..fc75cb5d 100644 --- a/sources/ParserMain.cpp +++ b/sources/ParserMain.cpp @@ -13,7 +13,7 @@ public: int getNumMasters() const noexcept { return numMasters; } int getNumCurves() const noexcept { return numCurves; } protected: - void callback(std::string_view header, std::vector members [[maybe_unused]]) final + void callback(std::string_view header, const std::vector& members [[maybe_unused]]) final { switch (hash(header)) { diff --git a/sources/Synth.cpp b/sources/Synth.cpp index d4ad9965..5f7b48a9 100644 --- a/sources/Synth.cpp +++ b/sources/Synth.cpp @@ -4,14 +4,14 @@ #include #include -void sfz::Synth::callback(std::string_view header, std::vector members) +void sfz::Synth::callback(std::string_view header, const std::vector& members) { switch (hash(header)) { case hash("global"): // We shouldn't have multiple global headers in file ASSERT(!hasGlobal); - globalOpcodes = std::move(members); + globalOpcodes = members; hasGlobal = true; break; case hash("control"): @@ -20,11 +20,11 @@ void sfz::Synth::callback(std::string_view header, std::vector members) hasControl = true; break; case hash("master"): - masterOpcodes = std::move(members); + masterOpcodes = members; numMasters++; break; case hash("group"): - groupOpcodes = std::move(members); + groupOpcodes = members; numGroups++; break; case hash("region"): diff --git a/sources/Synth.h b/sources/Synth.h index f66100e5..1bc9b6b4 100644 --- a/sources/Synth.h +++ b/sources/Synth.h @@ -129,7 +129,7 @@ public: void tempo(int delay, float secondsPerQuarter); protected: - void callback(std::string_view header, std::vector members) final; + void callback(std::string_view header, const std::vector& members) final; private: Voice* findFreeVoice()