Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49b5933

Browse filesBrowse files
MaleDongtargos
authored andcommitted
lib: simplify 'processChunkSync'
According to the real logic codes, it seems no matter whether 'nread >= kMaxLength' or not. We always close the 'self' stream first. So we can shorten it by merging them into one sample. PR-URL: #22802 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com>
1 parent f0a4017 commit 49b5933
Copy full SHA for 49b5933

File tree

Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed
Open diff view settings
Collapse file

‎lib/zlib.js‎

Copy file name to clipboardExpand all lines: lib/zlib.js
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,12 @@ function processChunkSync(self, chunk, flushFlag) {
527527
}
528528

529529
self.bytesWritten = inputRead;
530+
_close(self);
530531

531532
if (nread >= kMaxLength) {
532-
_close(self);
533533
throw new ERR_BUFFER_TOO_LARGE();
534534
}
535535

536-
_close(self);
537-
538536
if (nread === 0)
539537
return Buffer.alloc(0);
540538

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.