Skip to content

Commit

Permalink
Fixing jashkenas#95 ... Maloptimization of _.keys for sparse arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jan 18, 2011
1 parent 49787c2 commit 2f369f8
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = nativeKeys || function(obj) {
if (_.isArray(obj)) return _.range(0, obj.length);
var keys = [];
for (var key in obj) if (hasOwnProperty.call(obj, key)) keys[keys.length] = key;
return keys;
Expand Down

0 comments on commit 2f369f8

Please sign in to comment.