From fc334b3a977d45f8eecff7f9f48a86de8b5c0526 Mon Sep 17 00:00:00 2001 From: Jorge Chamorro Bieling Date: Sun, 19 Sep 2010 10:05:01 +0200 Subject: [PATCH] sys.js: --needless Object.keys() --needless .map() in a single patch --- lib/sys.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/sys.js b/lib/sys.js index 0c027f5d32..ca97a88495 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -106,13 +106,8 @@ exports.inspect = function (obj, showHidden, depth, colors) { } // Look up the keys of the object. - if (showHidden) { - var keys = Object.getOwnPropertyNames(value).map(function (key) { return '' + key; }); - } else { - var keys = Object.keys(value); - } - var visible_keys = Object.keys(value); + var keys = showHidden ? Object.getOwnPropertyNames(value) : visible_keys; // Functions without properties can be shortcutted. if (typeof value === 'function' && keys.length === 0) {