File tree 2 files changed +6
-5
lines changed
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;
36
36
* by calling this one.
37
37
*/
38
38
::testing::AssertionResult eventuallyTrue (
39
- std::function<::testing::AssertionResult(bool )> test,
39
+ const std::function<::testing::AssertionResult(bool )>& test,
40
40
uint64_t timeoutSecs) {
41
41
constexpr uint64_t kMicrosPerSec = 1000000 ;
42
42
const uint64_t timeoutUSec = timeoutSecs * kMicrosPerSec ;
Original file line number Diff line number Diff line change 30
30
#include < folly/logging/xlog.h>
31
31
32
32
#include < numeric>
33
+ #include < utility>
33
34
34
35
namespace facebook {
35
36
namespace cachelib {
@@ -74,14 +75,14 @@ class CounterVisitor {
74
75
}
75
76
76
77
void operator =(std::function<void (folly::StringPiece, double )> biFn) {
77
- biFn_ = biFn;
78
+ biFn_ = std::move ( biFn) ;
78
79
triFn_ = nullptr ;
79
80
init ();
80
81
}
81
82
82
83
void operator =(
83
84
std::function<void (folly::StringPiece, double , CounterType)> triFn) {
84
- triFn_ = triFn;
85
+ triFn_ = std::move ( triFn) ;
85
86
biFn_ = nullptr ;
86
87
init ();
87
88
}
@@ -133,10 +134,10 @@ class StatsMap {
133
134
}
134
135
135
136
// 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; }
137
138
138
139
// 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; }
140
141
141
142
const std::unordered_map<std::string, double >& getCounts () const {
142
143
return countMap;
You can’t perform that action at this time.
0 commit comments