Skip to content

Commit

Permalink
fs: remove unnecessary ?? operator
Browse files Browse the repository at this point in the history
This was introduced in 57678e5

With the `if` conditional around this statement, `options` will always
be evaluated as truthy. That means that the nullish coalescing operator
will always evaluate to the left side, make it unnecessary.

PR-URL: #43073
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
  • Loading branch information
mroderick authored and juanarbol committed May 31, 2022
1 parent b56a91a commit cdda735
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
offset = 0,
length = buffer.byteLength - offset,
position = null
} = offset ?? ObjectCreate(null));
} = offset);
}

if (offset == null) {
Expand Down

0 comments on commit cdda735

Please sign in to comment.