From 83ad9c6c4d015ff1a8075bf69036d284af24a18e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 6 Oct 2024 17:14:26 -0400 Subject: Pass strings and large structures by const reference --- include/ingen/ClashAvoider.hpp | 6 +++--- include/ingen/URI.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/ingen/ClashAvoider.hpp b/include/ingen/ClashAvoider.hpp index c1d62754..c0091fbc 100644 --- a/include/ingen/ClashAvoider.hpp +++ b/include/ingen/ClashAvoider.hpp @@ -48,9 +48,9 @@ public: * @param new_path The new path that `old_path` was mapped to * @param name The old name. */ - static std::string adjust_name(const raul::Path& old_path, - const raul::Path& new_path, - std::string name); + static std::string adjust_name(const raul::Path& old_path, + const raul::Path& new_path, + const std::string& name); private: using Offsets = std::map; diff --git a/include/ingen/URI.hpp b/include/ingen/URI.hpp index a45fb268..959f2290 100644 --- a/include/ingen/URI.hpp +++ b/include/ingen/URI.hpp @@ -40,7 +40,7 @@ public: explicit URI(const char* str); URI(const std::string& str, const URI& base); URI(const Sord::Node& node); - URI(SerdNode node); + URI(const SerdNode& node); explicit URI(const FilePath& path); URI(const URI& uri); @@ -98,7 +98,7 @@ public: } private: - URI(SerdNode node, SerdURI uri); + URI(const SerdNode& node, const SerdURI& uri); static Chunk make_chunk(const SerdChunk& chunk) { return {reinterpret_cast(chunk.buf), chunk.len}; -- cgit v1.2.1