mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: simplify LibuvStreamWrap::DoWrite
PR-URL: https://github.com/nodejs/node/pull/24588 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
1dfa1a2acb
commit
5e2ecd40bc
1 file changed
+6
-19
+6
-19
@@ -359,25 +359,12 @@ int LibuvStreamWrap::DoWrite(WriteWrap* req_wrap,
|
||||
size_t count,
|
||||
uv_stream_t* send_handle) {
|
||||
LibuvWriteWrap* w = static_cast<LibuvWriteWrap*>(req_wrap);
|
||||
int r;
|
||||
if (send_handle == nullptr) {
|
||||
r = w->Dispatch(uv_write, stream(), bufs, count, AfterUvWrite);
|
||||
} else {
|
||||
r = w->Dispatch(uv_write2,
|
||||
stream(),
|
||||
bufs,
|
||||
count,
|
||||
send_handle,
|
||||
AfterUvWrite);
|
||||
}
|
||||
|
||||
if (!r) {
|
||||
size_t bytes = 0;
|
||||
for (size_t i = 0; i < count; i++)
|
||||
bytes += bufs[i].len;
|
||||
}
|
||||
|
||||
return r;
|
||||
return w->Dispatch(uv_write2,
|
||||
stream(),
|
||||
bufs,
|
||||
count,
|
||||
send_handle,
|
||||
AfterUvWrite);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user