From 5e0c4d7b7a4017f86c203a0101e27fea46839f69 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 8 Apr 2015 10:50:04 +0200 Subject: [PATCH] Avoid Function#apply() for performance. --- packages/xo-collection/src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/xo-collection/src/index.js b/packages/xo-collection/src/index.js index dc446409c..39c2fc270 100644 --- a/packages/xo-collection/src/index.js +++ b/packages/xo-collection/src/index.js @@ -128,7 +128,7 @@ export default class Collection extends EventEmitter { } add (keyOrObjectWithId, valueIfKey = null) { - const [key, value] = this._resolveEntry.apply(this, arguments) + const [key, value] = this._resolveEntry(keyOrObjectWithId, valueIfKey) this._assertHasNot(key) this._map[key] = value @@ -139,7 +139,7 @@ export default class Collection extends EventEmitter { } set (keyOrObjectWithId, valueIfKey = null) { - const [key, value] = this._resolveEntry.apply(this, arguments) + const [key, value] = this._resolveEntry(keyOrObjectWithId, valueIfKey) const action = this.has(key) ? 'update' : 'add' this._map[key] = value @@ -165,7 +165,7 @@ export default class Collection extends EventEmitter { } update (keyOrObjectWithId, valueIfKey = null) { - const [key, value] = this._resolveEntry.apply(this, arguments) + const [key, value] = this._resolveEntry(keyOrObjectWithId, valueIfKey) this._assertHas(key) this._map[key] = value