mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
src: reduce variable scope in stream_base.cc
PR-URL: https://github.com/nodejs/node/pull/23297 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
7ee8323725
commit
f7bfbb8136
@ -209,8 +209,6 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
|
||||
if (args[2]->IsObject())
|
||||
send_handle_obj = args[2].As<Object>();
|
||||
|
||||
int err;
|
||||
|
||||
// Compute the size of the storage that the string will be flattened into.
|
||||
// For UTF8 strings that are very long, go ahead and take the hit for
|
||||
// computing their actual size, rather than tripling the storage.
|
||||
@ -243,7 +241,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
uv_buf_t* bufs = &buf;
|
||||
size_t count = 1;
|
||||
err = DoTryWrite(&bufs, &count);
|
||||
const int err = DoTryWrite(&bufs, &count);
|
||||
// Keep track of the bytes written here, because we're taking a shortcut
|
||||
// by using `DoTryWrite()` directly instead of using the utilities
|
||||
// provided by `Write()`.
|
||||
|
Loading…
Reference in New Issue
Block a user