summaryrefslogtreecommitdiffstats
path: root/src/lib/stats
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2023-12-20 20:06:42 +0100
committerRazvan Becheriu <razvan@isc.org>2024-01-22 16:33:26 +0100
commit54dd674d0da13aac0cf2ca484842740477276e26 (patch)
tree884e70409a29a318cf9b038855204a8edbd042b0 /src/lib/stats
parent[#3119] Fixed some coverity reported defects (diff)
downloadkea-54dd674d0da13aac0cf2ca484842740477276e26.tar.xz
kea-54dd674d0da13aac0cf2ca484842740477276e26.zip
[#3119] use auto const& whenever possible
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);
}