Module: check_mk
Branch: master
Commit: 5731df572c4ed555645b7c5291ad19d4c5b02b7a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5731df572c4ed5…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Thu Feb 22 08:40:53 2018 +0100
Windows agent: use const ref in range-based loops
---
agents/windows/Configuration.cc | 2 +-
agents/windows/build_version | 2 +-
agents/windows/sections/SectionFileinfo.cc | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/agents/windows/Configuration.cc b/agents/windows/Configuration.cc
index 01ff9c1..48431c4 100644
--- a/agents/windows/Configuration.cc
+++ b/agents/windows/Configuration.cc
@@ -114,7 +114,7 @@ std::vector<EntryPair> collectKeyValuePairs(const Entry
§ion,
void feedSection(const std::string &hostname, ConfigurableMap &configurables,
const Entry §ion, const CSimpleIni &ini) {
- for (const auto kvPair : collectKeyValuePairs(section, ini)) {
+ for (const auto &kvPair : collectKeyValuePairs(section, ini)) {
std::string variable{kvPair.first.pItem}; // intentional copy
std::transform(variable.cbegin(), variable.cend(), variable.begin(),
tolower);
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 32c211c..9a1248b 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-3110
+3112
diff --git a/agents/windows/sections/SectionFileinfo.cc
b/agents/windows/sections/SectionFileinfo.cc
index b111aab..082e5a9 100644
--- a/agents/windows/sections/SectionFileinfo.cc
+++ b/agents/windows/sections/SectionFileinfo.cc
@@ -77,7 +77,7 @@ void SectionFileinfo::get_directories(std::string base_path) {
void SectionFileinfo::determine_filepaths_full_search(
std::string base_path, std::string search_pattern) {
get_directories(base_path);
- for (auto entry : _temp_files) {
+ for (const auto &entry : _temp_files) {
if (globmatch(search_pattern.c_str(), entry.c_str())) {
_found_files.push_back(entry);
}
@@ -129,7 +129,7 @@ void SectionFileinfo::outputFileinfos(std::ostream &out, const
char *path) {
determine_filepaths(search_pattern);
bool found_file = false;
- for (auto entry : _found_files) {
+ for (const auto &entry : _found_files) {
found_file = outputFileinfo(out, entry) || found_file;
}