From fa3063d1481d1145038fefb1a7a066d2c5381673 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Wed, 3 Dec 2025 11:09:44 +0100 Subject: [PATCH] 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. --- lib/remote/httputility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/remote/httputility.cpp b/lib/remote/httputility.cpp index a3c853812..fbf95f2a9 100644 --- a/lib/remote/httputility.cpp +++ b/lib/remote/httputility.cpp @@ -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; }