Permalink
Browse files

Minor optimization for Hash

  • Loading branch information...
1 parent be9dc54 commit 5e835264493e06e022ceca028ca5ee8f477d6f83 @creationix committed Aug 19, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/hash.js
View
@@ -3,7 +3,7 @@
var Hash = module.exports = Object.create(Object.prototype, {
// Make for easy converting objects to hashes.
new: {value: function (value) {
- value = value || {};
+ if (value === undefined) return Object.create(Hash);
value.__proto__ = Hash;
return value;
}},

0 comments on commit 5e83526

Please sign in to comment.