summaryrefslogtreecommitdiff
path: root/include/multipart_parser.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-08-07 04:12:20 +0300
committerEd Tanous <ed@tanous.net>2023-08-21 22:29:33 +0300
commit3544d2a719c8bb7b07f9a39f61a3770ec84b909f (patch)
treedcce5cb8ee0219d04eea93d3f639f62e1f1c05a1 /include/multipart_parser.hpp
parent5ab47856f8499a5d2d393d1584b8fc402399eddf (diff)
downloadbmcweb-3544d2a719c8bb7b07f9a39f61a3770ec84b909f.tar.xz
Use ranges
C++20 brought us std::ranges for a lot of algorithms. Most of these conversions were done using comby, similar to: ``` comby -verbose 'std::lower_bound(:[a].begin(),:[b].end(),:[c])' 'std::ranges::lower_bound(:[a], :[c])' $(git ls-files | grep "\.[hc]\(pp\)\?$") -in-place ``` Change-Id: I0c99c04e9368312555c08147d474ca93a5959e8d Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'include/multipart_parser.hpp')
-rw-r--r--include/multipart_parser.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/multipart_parser.hpp b/include/multipart_parser.hpp
index 5ac196dd31..f707abfa5a 100644
--- a/include/multipart_parser.hpp
+++ b/include/multipart_parser.hpp
@@ -4,6 +4,7 @@
#include <boost/beast/http/fields.hpp>
+#include <ranges>
#include <string>
#include <string_view>
@@ -224,7 +225,7 @@ class MultipartParser
private:
void indexBoundary()
{
- std::fill(boundaryIndex.begin(), boundaryIndex.end(), 0);
+ std::ranges::fill(boundaryIndex, 0);
for (const char current : boundary)
{
boundaryIndex[static_cast<unsigned char>(current)] = true;