Skip to content

Commit

Permalink
src: simplify LibuvStreamWrap::DoWrite
Browse files Browse the repository at this point in the history
PR-URL: #24588
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
addaleax authored and targos committed Nov 29, 2018
1 parent b554ff7 commit a122ba5
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions src/stream_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit a122ba5

Please sign in to comment.