From 85ebf7fffa649cbd0d985f8c1eceab0d3b2f0342 Mon Sep 17 00:00:00 2001 From: Soreine Date: Wed, 2 Nov 2016 16:50:17 +0100 Subject: [PATCH] Remove extra LEAF in memoize --- src/utils/memoize.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/utils/memoize.js b/src/utils/memoize.js index 8908446b6..1b556c802 100644 --- a/src/utils/memoize.js +++ b/src/utils/memoize.js @@ -1,16 +1,6 @@ import { Map } from 'immutable' -/** - * The leaf node of a cache tree. - * - * An object, so that immutable maps will key it by reference. - * - * @type {Object} - */ - -const LEAF = {} - /** * An unique value used to detect cache misses * @@ -36,7 +26,7 @@ function memoize(object, properties) { } object[property] = function (...args) { - const keys = [property, ...args, LEAF] + const keys = [property, ...args] this.__cache = this.__cache || new Map() const cachedValue = this.__cache.getIn(keys, NO_SET)