Get rid of Index.nodes, -1 Get.threadFromRoot call.

This commit is contained in:
Mayhem 2014-02-27 17:42:52 +01:00
parent 5581281c2e
commit 2924711db4

View File

@ -485,12 +485,10 @@ Index =
thread.collect()
return
buildThreads: ->
Index.nodes = []
threads = []
posts = []
threads = []
posts = []
for threadData, i in Index.liveThreadData
threadRoot = Build.thread g.BOARD, threadData
Index.nodes.push threadRoot
if thread = g.BOARD.threads[threadData.no]
thread.setPage i // Index.threadsNumPerPage
thread.setCount 'post', threadData.replies + 1, threadData.bumplimit
@ -577,7 +575,7 @@ Index =
when 'filecount'
sortedThreadIDs = [Index.liveThreadData...].sort((a, b) -> b.images - a.images).map (data) -> data.no
Index.sortedThreads = sortedThreadIDs
.map (threadID) -> Get.threadFromRoot Index.nodes[Index.liveThreadIDs.indexOf threadID]
.map (threadID) -> g.BOARD.threads[threadID]
.filter (thread) -> thread.isHidden is Index.showHiddenThreads
if Index.isSearching
Index.sortedThreads = Index.querySearch(Index.searchInput.value) or Index.sortedThreads