to save the overhead of creating and destoying a copy of the function
closure.
Signed-off-by: Kefu Chai <kchai@redhat.com>
DECODE_FINISH(p);
}
-void FSMap::sanitize(std::function<bool(int64_t pool)> pool_exists)
+void FSMap::sanitize(const std::function<bool(int64_t pool)>& pool_exists)
{
for (auto &fs : filesystems) {
fs.second->mds_map.sanitize(pool_exists);
bufferlist::iterator p = bl.begin();
decode(p);
}
- void sanitize(std::function<bool(int64_t pool)> pool_exists);
+ void sanitize(const std::function<bool(int64_t pool)>& pool_exists);
void print(ostream& out) const;
void print_summary(Formatter *f, ostream *out) const;
ENCODE_FINISH(bl);
}
-void MDSMap::sanitize(std::function<bool(int64_t pool)> pool_exists)
+void MDSMap::sanitize(const std::function<bool(int64_t pool)>& pool_exists)
{
/* Before we did stricter checking, it was possible to remove a data pool
* without also deleting it from the MDSMap. Check for that here after
bufferlist::iterator p = bl.begin();
decode(p);
}
- void sanitize(std::function<bool(int64_t pool)> pool_exists);
+ void sanitize(const std::function<bool(int64_t pool)>& pool_exists);
void print(ostream& out) const;
void print_summary(Formatter *f, ostream *out) const;