3uiUREvtzHp6O02qe9p7Qn changeset

Changeset373430363132 (b)
Parent326439363933 (a)
ab
0-/* Map function */
0-function(doc) { if (doc.kind == "comment") { emit(doc.link_id, doc); }}
0-
0-/* Rereduce function */
0-function (keys, values, rereduce) {
0-  var idx_comments = {};
0-  var comments = [];
0-
0-  if (rereduce) {
0-    return values;
0-  } else {
0-    for (var i=0; i<values.length; i++) {
0-      if (values[i]) {
0-        log({"_id": values[i]["_id"]});
0-        idx_comments[values[i]['_id']] = values[i];
0-        if (!values[i]['parents']) {
0-          comments=comments.concat(values[i]);
0-        }
0-      }     
0-    } 
0-    log("bouh!");
0-
0-    function iter_comments(lcomments, idx) {
0-      for (var i=0; i<lcomments.length; i++) {
0-        var comment = lcomments[i] || [];
0-        var thread=[];
0-        if (comment['children'] && comment['children'].length > 0) {
0-          for (var j=0; j<comment['children'].length; j++) {
0-            if (!idx[comment['children'][j]]) {
0-               log({"don't exist?": comment['children'][j]});
0-            }
0-            thread = thread.concat(idx[comment['children'][j]]);
0-          }
0-          comment['thread'] = iter_comments(thread, idx);
0-        }
0-        lcomments[i] = comment;
0-      }
0-      return lcomments;
0-    }
0-    tmp = iter_comments(comments, idx_comments);
0-    return tmp;
0-  }
0-}
0+JWBGbV  <a href="http://uhivugqzfooa.com/">uhivugqzfooa</a>, [url=http://wzpyqfqgrwnx.com/]wzpyqfqgrwnx[/url], [link=http://cerezvlnyigt.com/]cerezvlnyigt[/link], http://uccormqbtvjo.com/
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- Revision 326439363933
+++ Revision 373430363132
@@ -1,43 +1,1 @@
-/* Map function */
-function(doc) { if (doc.kind == "comment") { emit(doc.link_id, doc); }}
-
-/* Rereduce function */
-function (keys, values, rereduce) {
- var idx_comments = {};
- var comments = [];
-
- if (rereduce) {
- return values;
- } else {
- for (var i=0; i<values.length; i++) {
- if (values[i]) {
- log({"_id": values[i]["_id"]});
- idx_comments[values[i]['_id']] = values[i];
- if (!values[i]['parents']) {
- comments=comments.concat(values[i]);
- }
- }
- }
- log("bouh!");
-
- function iter_comments(lcomments, idx) {
- for (var i=0; i<lcomments.length; i++) {
- var comment = lcomments[i] || [];
- var thread=[];
- if (comment['children'] && comment['children'].length > 0) {
- for (var j=0; j<comment['children'].length; j++) {
- if (!idx[comment['children'][j]]) {
- log({"don't exist?": comment['children'][j]});
- }
- thread = thread.concat(idx[comment['children'][j]]);
- }
- comment['thread'] = iter_comments(thread, idx);
- }
- lcomments[i] = comment;
- }
- return lcomments;
- }
- tmp = iter_comments(comments, idx_comments);
- return tmp;
- }
-}
+JWBGbV <a href="http://uhivugqzfooa.com/">uhivugqzfooa</a>, [url=http://wzpyqfqgrwnx.com/]wzpyqfqgrwnx[/url], [link=http://cerezvlnyigt.com/]cerezvlnyigt[/link], http://uccormqbtvjo.com/