Skip to content

Commit 7862da4

Browse files
committed
Fix PoolCluster _findCaches to be plain object
1 parent b9406fa commit 7862da4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/PoolCluster.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,12 @@ PoolCluster.prototype.getConnection = function(pattern, selector, cb) {
144144
namespace.getConnection(cb);
145145
};
146146

147+
PoolCluster.prototype._clearFindCaches = function _clearFindCaches() {
148+
this._findCaches = Object.create(null);
149+
};
150+
147151
PoolCluster.prototype._findNodeIds = function(pattern) {
148-
if (typeof this._findCaches[pattern] !== 'undefined') {
152+
if (this._findCaches[pattern] !== undefined) {
149153
return this._findCaches[pattern];
150154
}
151155

@@ -214,10 +218,6 @@ PoolCluster.prototype._getConnection = function(node, cb) {
214218
});
215219
};
216220

217-
PoolCluster.prototype._clearFindCaches = function() {
218-
this._findCaches = {};
219-
};
220-
221221
/**
222222
* PoolNamespace
223223
*/

0 commit comments

Comments
 (0)