From 7862da4261730c59b12cda8ec66a218d067e2ba4 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 22 Mar 2015 21:36:59 -0400 Subject: [PATCH] Fix PoolCluster _findCaches to be plain object --- lib/PoolCluster.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PoolCluster.js b/lib/PoolCluster.js index 687184040..0c9cae676 100644 --- a/lib/PoolCluster.js +++ b/lib/PoolCluster.js @@ -144,8 +144,12 @@ PoolCluster.prototype.getConnection = function(pattern, selector, cb) { namespace.getConnection(cb); }; +PoolCluster.prototype._clearFindCaches = function _clearFindCaches() { + this._findCaches = Object.create(null); +}; + PoolCluster.prototype._findNodeIds = function(pattern) { - if (typeof this._findCaches[pattern] !== 'undefined') { + if (this._findCaches[pattern] !== undefined) { return this._findCaches[pattern]; } @@ -214,10 +218,6 @@ PoolCluster.prototype._getConnection = function(node, cb) { }); }; -PoolCluster.prototype._clearFindCaches = function() { - this._findCaches = {}; -}; - /** * PoolNamespace */