util: speed up formatting of large arrays/objects
authorBen Noordhuis <info@bnoordhuis.nl>
Wed, 27 Jun 2012 17:15:28 +0000 (19:15 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 28 Jun 2012 01:51:42 +0000 (03:51 +0200)
commit6531f187d877da403af0bbe5aa9814705e5ace61
treefc3ae6a03b790c41d019a512d93a61fe44d9a5fa
parentbe3afd0becdff628c4e57c90b889210ae7db7a23
util: speed up formatting of large arrays/objects

Don't .indexOf() into the keys array. V8 is smart but not so smart that it
knows how to turn the linear scan into a O(1) lookup.

Fixes #3562.
lib/util.js