From 879a906efaeeb4ee1db5a799cc35f9843485e3f7 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 27 Mar 2020 18:30:35 +0200 Subject: [core] Fix bugprone-virtual-near-miss errors As reported by clang-tidy-8. --- platform/node/src/node_request.cpp | 18 +++++++++--------- platform/node/src/node_request.hpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/platform/node/src/node_request.cpp b/platform/node/src/node_request.cpp index 78f50ea9ce..17e3053529 100644 --- a/platform/node/src/node_request.cpp +++ b/platform/node/src/node_request.cpp @@ -60,7 +60,7 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf auto callback = std::move(request->callback); request->callback = {}; if (!callback) { - request->unref(); + request->unrefRequest(); return info.GetReturnValue().SetUndefined(); } @@ -84,7 +84,7 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf *Nan::Utf8String(info[0]) ); } else if (info.Length() < 2 || !info[1]->IsObject()) { - request->unref(); + request->unrefRequest(); return Nan::ThrowTypeError("Second argument must be a response object"); } else { auto res = Nan::To(info[1]).ToLocalChecked(); @@ -118,7 +118,7 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf node::Buffer::Length(data) ); } else { - request->unref(); + request->unrefRequest(); return Nan::ThrowTypeError("Response data must be a Buffer"); } } @@ -126,15 +126,15 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf // Send the response object to the NodeFileSource object callback(response); - request->unref(); + request->unrefRequest(); info.GetReturnValue().SetUndefined(); } -void NodeRequest::unref() { - Nan::HandleScope scope; - delete asyncResource; - asyncResource = nullptr; - Unref(); +void NodeRequest::unrefRequest() { + Nan::HandleScope scope; + delete asyncResource; + asyncResource = nullptr; + Unref(); } NodeAsyncRequest::NodeAsyncRequest() : request(nullptr) {} diff --git a/platform/node/src/node_request.hpp b/platform/node/src/node_request.hpp index 0621940bb1..a7c2545fc2 100644 --- a/platform/node/src/node_request.hpp +++ b/platform/node/src/node_request.hpp @@ -34,7 +34,7 @@ public: static void New(const Nan::FunctionCallbackInfo&); static void HandleCallback(const Nan::FunctionCallbackInfo&); - void unref(); + void unrefRequest(); mbgl::FileSource::Callback callback; NodeAsyncRequest* asyncRequest; -- cgit v1.2.1