_.size ludicrous speed improvement - formatting

This commit is contained in:
Raymond May Jr
2012-03-19 19:10:59 -05:00
parent 2d3edb88f0
commit 5827e4a40a

View File

@@ -309,11 +309,11 @@
// Return the number of elements in an object. // Return the number of elements in an object.
_.size = function(obj) { _.size = function(obj) {
if (_.isArray(obj)) { if (_.isArray(obj)) {
return obj.length; return obj.length;
} else { }else{
return _.keys(obj).length; return _.keys(obj).length;
} }
}; };
// Array Functions // Array Functions