Shave a couple of lines.

I probably did this for perf reasons, but it most likely doesn't make much of a difference.
This commit is contained in:
Mayhem 2013-06-25 20:45:34 +02:00
parent 90f75de0e2
commit 51358e328a

View File

@ -181,20 +181,18 @@ Main =
threads = [] threads = []
posts = [] posts = []
for boardChild in board.children for threadRoot in $$ '.board > .thread', board
continue unless $.hasClass boardChild, 'thread' thread = new Thread threadRoot.id[1..], g.BOARD
thread = new Thread boardChild.id[1..], g.BOARD
threads.push thread threads.push thread
for threadChild in boardChild.children for postRoot in $$ '.thread > .postContainer', threadRoot
continue unless $.hasClass threadChild, 'postContainer'
try try
posts.push new Post threadChild, thread, g.BOARD posts.push new Post postRoot, thread, g.BOARD
catch err catch err
# Skip posts that we failed to parse. # Skip posts that we failed to parse.
unless errors unless errors
errors = [] errors = []
errors.push errors.push
message: "Parsing of Post No.#{threadChild.id.match(/\d+/)} failed. Post will be skipped." message: "Parsing of Post No.#{postRoot.id.match(/\d+/)} failed. Post will be skipped."
error: err error: err
Main.handleErrors errors if errors Main.handleErrors errors if errors