diff options
author | cjihrig <cjihrig@gmail.com> | 2018-10-06 16:21:32 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-10-09 08:33:38 -0400 |
commit | f7bfbb81369d87dd55b645e10e3fb26f7a8216ad (patch) | |
tree | 1632440543e2f7c13f3c127057d4b6358bfc14ec /src/stream_base.cc | |
parent | 7ee832372510ed3a3b0848f29c7360cb0dc59103 (diff) | |
download | android-node-v8-f7bfbb81369d87dd55b645e10e3fb26f7a8216ad.tar.gz android-node-v8-f7bfbb81369d87dd55b645e10e3fb26f7a8216ad.tar.bz2 android-node-v8-f7bfbb81369d87dd55b645e10e3fb26f7a8216ad.zip |
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>
Diffstat (limited to 'src/stream_base.cc')
-rw-r--r-- | src/stream_base.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/stream_base.cc b/src/stream_base.cc index f429f3593f..f44e188b5b 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -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()`. |