From 599d175142200e47bb25b4893aad279f3f3f647f Mon Sep 17 00:00:00 2001 From: Alec Gibson <12036746+alecgibson@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:55:02 +0100 Subject: [PATCH] Review markups - Clean up `arguments` -> `Array` --- lib/util.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/util.js b/lib/util.js index 8682fc2ad..f5ad1889f 100644 --- a/lib/util.js +++ b/lib/util.js @@ -101,11 +101,8 @@ exports.clone = function(obj) { exports.deduplicateRequests = function(fn) { var callbacksByArgs = {}; return function() { - var callback = arguments[arguments.length - 1]; - var args = []; - for (var i = 0; i < arguments.length - 1; i++) { - args.push(arguments[i]); - } + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); var argString = JSON.stringify(args); var callbacks = exports.digOrCreate(callbacksByArgs, argString, function() {