summaryrefslogtreecommitdiff
path: root/src/node_file.cc
diff options
context:
space:
mode:
authorgengjiawen <technicalcute@gmail.com>2019-03-07 21:46:54 +0800
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-12 20:34:36 +0100
commit575e086b6667c0bb8c89153891097938744f1f8a (patch)
treeaa5c70a11508b23a8da28d407143dd10021d62bb /src/node_file.cc
parent90fdf1b0d3811f5e1163d81a403b7e7071d279e5 (diff)
downloadandroid-node-v8-575e086b6667c0bb8c89153891097938744f1f8a.tar.gz
android-node-v8-575e086b6667c0bb8c89153891097938744f1f8a.tar.bz2
android-node-v8-575e086b6667c0bb8c89153891097938744f1f8a.zip
src: apply clang-tidy rule modernize-make-unique
PR-URL: https://github.com/nodejs/node/pull/26493 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_file.cc')
-rw-r--r--src/node_file.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_file.cc b/src/node_file.cc
index 137cac7279..79450fd15a 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -341,7 +341,7 @@ int FileHandle::ReadStart() {
.ToLocal(&wrap_obj)) {
return UV_EBUSY;
}
- read_wrap.reset(new FileHandleReadWrap(this, wrap_obj));
+ read_wrap = std::make_unique<FileHandleReadWrap>(this, wrap_obj);
}
}
int64_t recommended_read = 65536;
@@ -1285,8 +1285,8 @@ int MKDirpAsync(uv_loop_t* loop,
FSReqBase* req_wrap = FSReqBase::from_req(req);
// on the first iteration of algorithm, stash state information.
if (req_wrap->continuation_data == nullptr) {
- req_wrap->continuation_data = std::unique_ptr<FSContinuationData>{
- new FSContinuationData(req, mode, cb)};
+ req_wrap->continuation_data =
+ std::make_unique<FSContinuationData>(req, mode, cb);
req_wrap->continuation_data->PushPath(std::move(path));
}