# HG changeset patch # User Atul Varma # Date 1239754974 25200 # Node ID 96379dbafc530991279b18adfbd22205cfcd7ef5 # Parent e29662aba1b64b63729224d181021dbb89f22dea Got rid of a TODO, which also incidentally improved the performance of the reduce phase. diff -r e29662aba1b6 -r 96379dbafc53 browser-couch.js --- 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++;