fs: remove unnecessary ?? operator

This was introduced in 57678e55817366c39a3a241f89949c8fbe8418bc

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: https://github.com/nodejs/node/pull/43073
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
This commit is contained in:
Morgan Roderick 2022-05-15 06:25:53 +02:00 committed by GitHub
parent 8a5657bf9b
commit 4a34ece28f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -528,7 +528,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
offset = 0,
length = buffer.byteLength - offset,
position = null
} = offset ?? ObjectCreate(null));
} = offset);
}
if (offset == null) {