From 51358e328af2a3b3a944d13e36aa93f99d99aeb8 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Tue, 25 Jun 2013 20:45:34 +0200 Subject: [PATCH] Shave a couple of lines. I probably did this for perf reasons, but it most likely doesn't make much of a difference. --- src/General/Main.coffee | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 32c8d14b2..bd6239ba7 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -181,20 +181,18 @@ Main = threads = [] posts = [] - for boardChild in board.children - continue unless $.hasClass boardChild, 'thread' - thread = new Thread boardChild.id[1..], g.BOARD + for threadRoot in $$ '.board > .thread', board + thread = new Thread threadRoot.id[1..], g.BOARD threads.push thread - for threadChild in boardChild.children - continue unless $.hasClass threadChild, 'postContainer' + for postRoot in $$ '.thread > .postContainer', threadRoot try - posts.push new Post threadChild, thread, g.BOARD + posts.push new Post postRoot, thread, g.BOARD catch err # Skip posts that we failed to parse. unless errors errors = [] 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 Main.handleErrors errors if errors