changeset 52:96379dbafc53

Got rid of a TODO, which also incidentally improved the performance of the reduce phase.
author Atul Varma <varmaa@toolness.com>
date Tue, 14 Apr 2009 17:22:54 -0700
parents e29662aba1b6
children 08f868fc6e2b
files browser-couch.js
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/browser-couch.js	Tue Apr 14 17:17:22 2009 -0700
+++ b/browser-couch.js	Tue Apr 14 17:22:54 2009 -0700
@@ -240,10 +240,10 @@
         var key = mapKeys[i];
         var item = mapDict[key];
 
-        // TODO: The map() method is only available on JS 1.6.
-        var keys = item.keys.map(function pairKeyWithDocId(docId) {
-                                   return [key, docId];
-                                 });
+        var keys = [];
+        for (var j = 0; j < keys.length; j++)
+          newKeys.push([key, item.keys[j]]);
+
         rows.push({key: key,
                    value: reduce(keys, item.values)});
         i++;