GeezerVison is showing github.com — src: reduce variable scope in stream_base.cc · nodejs/node@4d761d4
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/stream_base.cc +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -209,8 +209,6 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) { |
209 | 209 | if (args[2]->IsObject()) |
210 | 210 | send_handle_obj = args[2].As<Object>(); |
211 | 211 |
|
212 | | - int err; |
213 | | - |
214 | 212 | // Compute the size of the storage that the string will be flattened into. |
215 | 213 | // For UTF8 strings that are very long, go ahead and take the hit for |
216 | 214 | // computing their actual size, rather than tripling the storage. |
@@ -243,7 +241,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) { |
243 | 241 |
|
244 | 242 | uv_buf_t* bufs = &buf; |
245 | 243 | size_t count = 1; |
246 | | - err = DoTryWrite(&bufs, &count); |
| 244 | + const int err = DoTryWrite(&bufs, &count); |
247 | 245 | // Keep track of the bytes written here, because we're taking a shortcut |
248 | 246 | // by using `DoTryWrite()` directly instead of using the utilities |
249 | 247 | // provided by `Write()`. |
|