Skip to content

Commit

Permalink
Optimization for counting keys in an object.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Fitzgerald committed Aug 8, 2012
1 parent 9ceb12a commit 19829ee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/consistent_hashing.js
Expand Up @@ -93,9 +93,7 @@ ConsistentHashing.prototype.getNodePosition = function(hash) {




ConsistentHashing.prototype.getRingLength = function() { ConsistentHashing.prototype.getRingLength = function() {
var i = 0; return Object.keys(this.ring).length;
for (var key in this.ring) { i++ }
return i;
}; };




Expand Down

0 comments on commit 19829ee

Please sign in to comment.