mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-03 20:40:17 -05:00
IsValidHeaderValue: use front()/back() instead of iterators
Don't ask me why I wasn't thinking of the very basic front() and back() methods when writing this code. Does exactly the same here, but is much more straight-forward than the extra iterator detour.
This commit is contained in:
parent
3ca8f0756f
commit
fa3063d148
1 changed files with 1 additions and 1 deletions
|
|
@ -138,7 +138,7 @@ bool HttpUtility::IsValidHeaderValue(std::string_view value)
|
|||
|
||||
if (!value.empty()) {
|
||||
// Must not start or end with space or tab.
|
||||
for (char c : {*value.begin(), *value.rbegin()}) {
|
||||
for (char c : {value.front(), value.back()}) {
|
||||
if (c == ' ' || c == '\t') {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue