diff options
author | Brian White <mscdex@mscdex.net> | 2017-08-21 03:31:24 -0400 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-08-23 08:23:15 -0700 |
commit | 893523931959f746a0ae6a73b39f5f8e5905b127 (patch) | |
tree | 48a7786961325ed1f7aadc9699a366bc9c0bd247 /src/stream_wrap.cc | |
parent | 7c948ce233c2401ca36ab66195fc0599011141ee (diff) | |
download | android-node-v8-893523931959f746a0ae6a73b39f5f8e5905b127.tar.gz android-node-v8-893523931959f746a0ae6a73b39f5f8e5905b127.tar.bz2 android-node-v8-893523931959f746a0ae6a73b39f5f8e5905b127.zip |
src: remove unnecessary helper function
Ever since e2fcfea46e, `OnReadCommon()` is no longer shared
between more than one function.
PR-URL: https://github.com/nodejs/node/pull/14959
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/stream_wrap.cc')
-rw-r--r-- | src/stream_wrap.cc | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 3497146cb0..eb156a91a2 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -242,13 +242,18 @@ void StreamWrap::OnReadImpl(ssize_t nread, } -void StreamWrap::OnReadCommon(uv_stream_t* handle, - ssize_t nread, - const uv_buf_t* buf, - uv_handle_type pending) { +void StreamWrap::OnRead(uv_stream_t* handle, + ssize_t nread, + const uv_buf_t* buf) { StreamWrap* wrap = static_cast<StreamWrap*>(handle->data); HandleScope scope(wrap->env()->isolate()); Context::Scope context_scope(wrap->env()->context()); + uv_handle_type type = UV_UNKNOWN_HANDLE; + + if (wrap->is_named_pipe_ipc() && + uv_pipe_pending_count(reinterpret_cast<uv_pipe_t*>(handle)) > 0) { + type = uv_pipe_pending_type(reinterpret_cast<uv_pipe_t*>(handle)); + } // We should not be getting this callback if someone as already called // uv_close() on the handle. @@ -262,22 +267,7 @@ void StreamWrap::OnReadCommon(uv_stream_t* handle, } } - static_cast<StreamBase*>(wrap)->OnRead(nread, buf, pending); -} - - -void StreamWrap::OnRead(uv_stream_t* handle, - ssize_t nread, - const uv_buf_t* buf) { - StreamWrap* wrap = static_cast<StreamWrap*>(handle->data); - uv_handle_type type = UV_UNKNOWN_HANDLE; - - if (wrap->is_named_pipe_ipc() && - uv_pipe_pending_count(reinterpret_cast<uv_pipe_t*>(handle)) > 0) { - type = uv_pipe_pending_type(reinterpret_cast<uv_pipe_t*>(handle)); - } - - OnReadCommon(handle, nread, buf, type); + static_cast<StreamBase*>(wrap)->OnRead(nread, buf, type); } |