From 26eee3a154f234d4cea80ba40a2091b739a60593 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Fri, 20 Oct 2023 20:54:01 -0500 Subject: multipart-parser: eliminate temporary to emplace_back Fix the following clang-tidy warning: ``` ../include/multipart_parser.hpp:108:50: error: unnecessary temporary object created while calling emplace_back [modernize-use-emplace,-warnings-as-errors] 108 | mime_fields.emplace_back(FormPart{}); | ^~~~~~~~~~ ``` Signed-off-by: Patrick Williams Change-Id: I362b4ad7f90f80a7746b79d643e3a7c5ff1db78c --- include/multipart_parser.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/multipart_parser.hpp b/include/multipart_parser.hpp index 94983f2456..9adf564cc7 100644 --- a/include/multipart_parser.hpp +++ b/include/multipart_parser.hpp @@ -105,7 +105,7 @@ class MultipartParser return ParserError::ERROR_BOUNDARY_LF; } index = 0; - mime_fields.emplace_back(FormPart{}); + mime_fields.emplace_back(); state = State::HEADER_FIELD_START; break; } @@ -305,7 +305,7 @@ class MultipartParser { // unset the PART_BOUNDARY flag flags = Boundary::NON_BOUNDARY; - mime_fields.emplace_back(FormPart{}); + mime_fields.emplace_back(); state = State::HEADER_FIELD_START; return ParserError::PARSER_SUCCESS; } -- cgit v1.2.3