From 7cb57e0c4672c352b583b6a3463854b226bab5f1 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 22 Oct 2024 19:32:03 +0200 Subject: [PATCH] fs: use make_unique if possible --- src/uvw/fs.ipp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uvw/fs.ipp b/src/uvw/fs.ipp index 7ba8e79e..5edbe81b 100644 --- a/src/uvw/fs.ipp +++ b/src/uvw/fs.ipp @@ -69,7 +69,7 @@ UVW_INLINE bool file_req::open_sync(const std::string &path, file_open_flags fla } UVW_INLINE void file_req::read(int64_t offset, unsigned int len) { - current = std::unique_ptr{new char[len]}; + current = std::make_unique(len); buffer = uv_buf_init(current.get(), len); uv_buf_t bufs[] = {buffer}; uv_fs_req_cleanup(this->raw()); @@ -77,7 +77,7 @@ UVW_INLINE void file_req::read(int64_t offset, unsigned int len) { } UVW_INLINE std::pair, std::size_t>> file_req::read_sync(int64_t offset, unsigned int len) { - current = std::unique_ptr{new char[len]}; + current = std::make_unique(len); buffer = uv_buf_init(current.get(), len); uv_buf_t bufs[] = {buffer}; auto req = raw();