Let's just wrap this all up into some nice, nested loops
This commit is contained in:
parent
53258c59ae
commit
2814818e9b
@ -3238,17 +3238,21 @@
|
||||
return Index.buildIndex();
|
||||
},
|
||||
parseThreadList: function(pages) {
|
||||
var i, live, page;
|
||||
var data, i, j, live, page, thread, threads;
|
||||
Index.threadsNumPerPage = pages[0].threads.length;
|
||||
live = [];
|
||||
data = [];
|
||||
i = 0;
|
||||
while (page = pages[i++]) {
|
||||
live = live.concat(page.threads);
|
||||
j = 0;
|
||||
threads = page.threads;
|
||||
live = live.concat(threads);
|
||||
while (thread = threads[j++]) {
|
||||
data.push(thread.no);
|
||||
}
|
||||
}
|
||||
Index.liveThreadData = live;
|
||||
Index.liveThreadIDs = Index.liveThreadData.map(function(data) {
|
||||
return data.no;
|
||||
});
|
||||
Index.liveThreadIDs = data;
|
||||
return g.BOARD.threads.forEach(function(thread) {
|
||||
var _ref;
|
||||
if (_ref = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref) < 0) {
|
||||
|
||||
@ -3297,17 +3297,21 @@
|
||||
return Index.buildIndex();
|
||||
},
|
||||
parseThreadList: function(pages) {
|
||||
var i, live, page;
|
||||
var data, i, j, live, page, thread, threads;
|
||||
Index.threadsNumPerPage = pages[0].threads.length;
|
||||
live = [];
|
||||
data = [];
|
||||
i = 0;
|
||||
while (page = pages[i++]) {
|
||||
live = live.concat(page.threads);
|
||||
j = 0;
|
||||
threads = page.threads;
|
||||
live = live.concat(threads);
|
||||
while (thread = threads[j++]) {
|
||||
data.push(thread.no);
|
||||
}
|
||||
}
|
||||
Index.liveThreadData = live;
|
||||
Index.liveThreadIDs = Index.liveThreadData.map(function(data) {
|
||||
return data.no;
|
||||
});
|
||||
Index.liveThreadIDs = data;
|
||||
return g.BOARD.threads.forEach(function(thread) {
|
||||
var _ref;
|
||||
if (_ref = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref) < 0) {
|
||||
|
||||
@ -561,14 +561,19 @@ Index =
|
||||
|
||||
parseThreadList: (pages) ->
|
||||
Index.threadsNumPerPage = pages[0].threads.length
|
||||
|
||||
live = []
|
||||
i = 0
|
||||
data = []
|
||||
i = 0
|
||||
while page = pages[i++]
|
||||
live = live.concat page.threads
|
||||
j = 0
|
||||
{threads} = page
|
||||
live = live.concat threads
|
||||
while thread = threads[j++]
|
||||
data.push thread.no
|
||||
|
||||
Index.liveThreadData = live
|
||||
Index.liveThreadIDs = data
|
||||
|
||||
Index.liveThreadData = live
|
||||
Index.liveThreadIDs = Index.liveThreadData.map (data) -> data.no
|
||||
g.BOARD.threads.forEach (thread) ->
|
||||
thread.collect() unless thread.ID in Index.liveThreadIDs
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user