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 4b267df

Browse filesBrowse files
ronkorvingsilverwind
authored andcommitted
udp: remove a needless instanceof Buffer check
When a string is passed to udpsock.send, it is automatically converted to a Buffer. In that case, it is no longer needed to test whether or not the argument is a Buffer or not. PR-URL: #4301 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Roman Reiss <me@silverwind.io>
1 parent f176b31 commit 4b267df
Copy full SHA for 4b267df

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎lib/dgram.js‎

Copy file name to clipboardExpand all lines: lib/dgram.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ Socket.prototype.send = function(buffer,
252252

253253
if (typeof buffer === 'string')
254254
buffer = new Buffer(buffer);
255-
256-
if (!(buffer instanceof Buffer))
255+
else if (!(buffer instanceof Buffer))
257256
throw new TypeError('First argument must be a buffer or string');
258257

259258
offset = offset | 0;

0 commit comments

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