From 835056cbcb6290ecf93365705dcec951c39dad25 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 ee41318d3b1eb1..e157df112b85ea 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -478,7 +478,7 @@ async function read(handle, bufferOrParams, offset, length, position) { offset = 0, length = buffer.byteLength - offset, position = null, - } = offset ?? ObjectCreate(null)); + } = offset); } if (offset == null) {