From 4d761d4224245029cffcd714f3cf7caa7d171c7f Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 6 Oct 2018 16:21:32 -0400 Subject: [PATCH] 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(-) diff --git a/src/stream_base.cc b/src/stream_base.cc index f429f3593fd5f4..f44e188b5b818c 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()`.