From f7bfbb81369d87dd55b645e10e3fb26f7a8216ad Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 6 Oct 2018 16:21:32 -0400 Subject: src: reduce variable scope in stream_base.cc PR-URL: https://github.com/nodejs/node/pull/23297 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Refael Ackermann Reviewed-By: Gabriel Schulhof Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- src/stream_base.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/stream_base.cc') 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& args) { if (args[2]->IsObject()) send_handle_obj = args[2].As(); - 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& 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()`. -- cgit v1.2.3