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:
Julian Brost 2025-12-03 11:09:44 +01:00
parent 3ca8f0756f
commit fa3063d148

View file

@ -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;
}