summaryrefslogtreecommitdiffstats
path: root/Source/cmFileMonitor.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-10-30 18:50:19 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-10-30 18:50:19 (GMT)
commit5214bb354b508cafc859b4a05b4e5f8ed44767e0 (patch)
treefbf3447860426ec363b14e548b4fec709b6ea12d /Source/cmFileMonitor.cxx
parent602b78aa79f6d99e775fa0a84fb441156d192833 (diff)
downloadCMake-5214bb354b508cafc859b4a05b4e5f8ed44767e0.zip
CMake-5214bb354b508cafc859b4a05b4e5f8ed44767e0.tar.gz
CMake-5214bb354b508cafc859b4a05b4e5f8ed44767e0.tar.bz2
Avoid some copies
Diffstat (limited to 'Source/cmFileMonitor.cxx')
-rw-r--r--Source/cmFileMonitor.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index b55341b..9844306 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -247,7 +247,10 @@ public:
void StopWatching() final {}
- void AppendCallback(cmFileMonitor::Callback cb) { CbList.push_back(cb); }
+ void AppendCallback(cmFileMonitor::Callback const& cb)
+ {
+ this->CbList.push_back(cb);
+ }
std::string Path() const final
{
@@ -310,7 +313,7 @@ cmFileMonitor::~cmFileMonitor()
}
void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
- Callback cb)
+ Callback const& cb)
{
for (const auto& p : paths) {
std::vector<std::string> pathSegments;