summaryrefslogtreecommitdiffstats
path: root/src/lib/stats
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/stats')
-rw-r--r--src/lib/stats/context.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/stats/context.cc b/src/lib/stats/context.cc
index 3675df9fbe..2a560efafd 100644
--- a/src/lib/stats/context.cc
+++ b/src/lib/stats/context.cc
@@ -60,7 +60,7 @@ StatContext::clear() {
void
StatContext::resetAll() {
// Let's iterate over all stored statistics...
- for (auto s : stats_) {
+ for (auto const& s : stats_) {
// ... and reset each statistic.
s.second->reset();
}
@@ -70,7 +70,7 @@ ConstElementPtr
StatContext::getAll() const {
ElementPtr map = Element::createMap(); // a map
// Let's iterate over all stored statistics...
- for (auto s : stats_) {
+ for (auto const& s : stats_) {
// ... and add each of them to the map.
map->set(s.first, s.second->getJSON());
}
@@ -89,7 +89,7 @@ StatContext::setMaxSampleCountAll(uint32_t max_samples) {
void
StatContext::setMaxSampleAgeAll(const StatsDuration& duration) {
// Let's iterate over all stored statistics...
- for (auto s : stats_) {
+ for (auto const& s : stats_) {
// ... and set duration limit for each statistic.
s.second->setMaxSampleAge(duration);
}