From bfd70c9dc9eb2ced0bd8a8e999e2836699c6c96c Mon Sep 17 00:00:00 2001 From: HBSPS Date: Fri, 16 Aug 2024 01:29:33 +0900 Subject: [PATCH] path: change `path.join` to use array dynamic allocation Change path.join to use array dynamic allocation instead of push. Refs: https://github.com/nodejs/node/pull/54331 --- lib/path.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/path.js b/lib/path.js index 48c7f67dcd617a..2a5b42f2c7a8fb 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1242,7 +1242,7 @@ const posix = { const arg = args[i]; validateString(arg, 'path'); if (arg.length > 0) { - path.push(arg); + path[path.length] = arg; } }