File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ constexpr uint64_t kDefaultTimeoutSecs = 30;
3636 * by calling this one.
3737 */
3838::testing::AssertionResult eventuallyTrue (
39- std::function<::testing::AssertionResult(bool )> test,
39+ const std::function<::testing::AssertionResult(bool )>& test,
4040 uint64_t timeoutSecs) {
4141 constexpr uint64_t kMicrosPerSec = 1000000 ;
4242 const uint64_t timeoutUSec = timeoutSecs * kMicrosPerSec ;
Original file line number Diff line number Diff line change 3030#include < folly/logging/xlog.h>
3131
3232#include < numeric>
33+ #include < utility>
3334
3435namespace facebook {
3536namespace cachelib {
@@ -74,14 +75,14 @@ class CounterVisitor {
7475 }
7576
7677 void operator =(std::function<void (folly::StringPiece, double )> biFn) {
77- biFn_ = biFn;
78+ biFn_ = std::move ( biFn) ;
7879 triFn_ = nullptr ;
7980 init ();
8081 }
8182
8283 void operator =(
8384 std::function<void (folly::StringPiece, double , CounterType)> triFn) {
84- triFn_ = triFn;
85+ triFn_ = std::move ( triFn) ;
8586 biFn_ = nullptr ;
8687 init ();
8788 }
@@ -133,10 +134,10 @@ class StatsMap {
133134 }
134135
135136 // Insert a count stat
136- void insertCount (std::string key, double val) { countMap[key] = val; }
137+ void insertCount (const std::string& key, double val) { countMap[key] = val; }
137138
138139 // Insert a rate stat
139- void insertRate (std::string key, double val) { rateMap[key] = val; }
140+ void insertRate (const std::string& key, double val) { rateMap[key] = val; }
140141
141142 const std::unordered_map<std::string, double >& getCounts () const {
142143 return countMap;
You can’t perform that action at this time.
0 commit comments