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 56dda6f

Browse filesBrowse files
benjamingrMyles Borins
authored andcommitted
fs: Remove unused branches
a few places the code was refactored to use `maybeCallback` which always returns a function. Checking for `if (callback)` always returns true anyway. PR-URL: #5289 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: thefourtheye <thechargingvolcano@gmail.com>
1 parent feedca7 commit 56dda6f
Copy full SHA for 56dda6f

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ function writeAll(fd, buffer, offset, length, position, callback_) {
10981098
fs.write(fd, buffer, offset, length, position, function(writeErr, written) {
10991099
if (writeErr) {
11001100
fs.close(fd, function() {
1101-
if (callback) callback(writeErr);
1101+
callback(writeErr);
11021102
});
11031103
} else {
11041104
if (written === length) {
@@ -1131,7 +1131,7 @@ fs.writeFile = function(path, data, options, callback_) {
11311131
var flag = options.flag || 'w';
11321132
fs.open(path, flag, options.mode, function(openErr, fd) {
11331133
if (openErr) {
1134-
if (callback) callback(openErr);
1134+
callback(openErr);
11351135
} else {
11361136
var buffer = (data instanceof Buffer) ? data : new Buffer('' + data,
11371137
options.encoding || 'utf8');

0 commit comments

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