Mercurial > browser-couch
diff browser-couch.js @ 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 | e82074d95e06 |
children | 3607a6844691 |
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++;