diff options
| author | 2021-04-06 20:06:18 +0100 | |
|---|---|---|
| committer | 2021-04-07 10:36:11 +0100 | |
| commit | 942fd2bcfd384a12c900999fe663202c87319a68 (patch) | |
| tree | c2bad1906af27afbc3c7d96c3e5ca3c27c83f090 /src/configparser.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Switch simple iterator loops to use range-based for loops.
Diffstat (limited to 'src/configparser.cpp')
| -rw-r--r-- | src/configparser.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 2622b7016..e6b312473 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -495,9 +495,12 @@ bool ConfigTag::readString(const std::string& key, std::string& value, bool allo { ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, "Value of <" + name + ":" + key + "> at " + source.str() + " contains a linefeed, and linefeeds in this value are not permitted -- stripped to spaces."); - for (std::string::iterator n = value.begin(); n != value.end(); n++) - if (*n == '\n') - *n = ' '; + + for (auto& chr : value) + { + if (chr == '\n') + chr = ' '; + } } return true; } |
