Skip to content

Commit 4d761d4

Browse files
cjihrigtargos
authored andcommitted
src: reduce variable scope in stream_base.cc
PR-URL: #23297 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 740741b commit 4d761d4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/stream_base.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
209209
if (args[2]->IsObject())
210210
send_handle_obj = args[2].As<Object>();
211211

212-
int err;
213-
214212
// Compute the size of the storage that the string will be flattened into.
215213
// For UTF8 strings that are very long, go ahead and take the hit for
216214
// computing their actual size, rather than tripling the storage.
@@ -243,7 +241,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
243241

244242
uv_buf_t* bufs = &buf;
245243
size_t count = 1;
246-
err = DoTryWrite(&bufs, &count);
244+
const int err = DoTryWrite(&bufs, &count);
247245
// Keep track of the bytes written here, because we're taking a shortcut
248246
// by using `DoTryWrite()` directly instead of using the utilities
249247
// provided by `Write()`.

0 commit comments

Comments
 (0)