summaryrefslogtreecommitdiff
path: root/libs/pbd/search_path.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2014-07-09 11:03:21 +1000
committerTim Mayberry <mojofunk@gmail.com>2015-08-18 15:09:44 +1000
commitea32eecf3d2fa22c87350a3b198f8c13707627c6 (patch)
treee084905f204892f28aada0f480d17e8bdb8f79d0 /libs/pbd/search_path.cc
parent6847b59721546cbd20eaebf8db34f5d241aa9585 (diff)
Fix Searchpath::operator+ to return by value rather than reference and not modify *this
ladspa_search_path was the only function using this API and it is unaffected by the change
Diffstat (limited to 'libs/pbd/search_path.cc')
-rw-r--r--libs/pbd/search_path.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/libs/pbd/search_path.cc b/libs/pbd/search_path.cc
index 44438cc85c..1d931a546d 100644
--- a/libs/pbd/search_path.cc
+++ b/libs/pbd/search_path.cc
@@ -124,19 +124,16 @@ Searchpath::operator+= (const std::string& directory_path)
return *this;
}
-Searchpath&
+const Searchpath
Searchpath::operator+ (const std::string& directory_path)
{
- add_directory (directory_path);
- return *this;
+ return Searchpath (*this) += directory_path;
}
-Searchpath&
+const Searchpath
Searchpath::operator+ (const Searchpath& spath)
{
- // concatenate paths into new Searchpath
- insert(end(), spath.begin(), spath.end());
- return *this;
+ return Searchpath (*this) += spath;
}
Searchpath&