From 5f27b4b651c14555279904cb44ed4f0344101aa8 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 29 Nov 2023 21:19:55 +0400 Subject: [PATCH] Taking advantage of std::make_unique() --- src/server/response.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/server/response.cpp b/src/server/response.cpp index 0fcb65052..8ccab1313 100644 --- a/src/server/response.cpp +++ b/src/server/response.cpp @@ -134,7 +134,7 @@ void Response::set_kind(Kind k) std::unique_ptr Response::build() { - return std::unique_ptr(new Response()); + return std::make_unique(); } std::unique_ptr Response::build_304(const ETag& etag) @@ -389,9 +389,7 @@ std::unique_ptr ContentResponse::build( const std::string& content, const std::string& mimetype) { - return std::unique_ptr(new ContentResponse( - content, - mimetype)); + return std::make_unique(content, mimetype); } std::unique_ptr ContentResponse::build( @@ -432,10 +430,7 @@ std::unique_ptr ItemResponse::build(const RequestContext& request, con return response; } - return std::unique_ptr(new ItemResponse( - item, - mimetype, - byteRange)); + return std::make_unique(item, mimetype, byteRange); } MHD_Response*