From becca06f9ba917e5a68e0f6b6212f31b0e1cb504 Mon Sep 17 00:00:00 2001 From: Morgan Roderick <20321+mroderick@users.noreply.github.com> Date: Sun, 15 May 2022 06:25:53 +0200 Subject: [PATCH] fs: remove unnecessary ?? operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Tobias Nießen Reviewed-By: LiviaMedeiros Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Anto Aravinth Reviewed-By: Akhil Marsonya --- lib/internal/fs/promises.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index ea9482e69dc904..9ae66a8e073442 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -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) {