From de5d903e460b2b50153b588704a4afcb74704144 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 9 Jan 2014 12:03:23 -0700 Subject: [PATCH] That was just a little too much going on in one line --- builds/4chan-X.user.js | 9 +++++++-- builds/crx/script.js | 9 +++++++-- src/Archive/Redirect.coffee | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 3137862c2..fe57c7b47 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -9790,9 +9790,14 @@ record = _ref[boardID]; for (type in record) { id = record[type]; - if ((archive = archives[id]) && __indexOf.call((type === 'file' ? archive['file'] : archive['boards']), boardID) >= 0) { - o[type][boardID] = archive.data; + if (!((archive = archives[id]))) { + continue; } + boards = type === 'file' ? archive.file : archive.boards; + if (__indexOf.call(boards, boardID) < 0) { + continue; + } + o[type][boardID] = archive.data; } } for (name in archives) { diff --git a/builds/crx/script.js b/builds/crx/script.js index cb8688299..c5e24e1cb 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -9779,9 +9779,14 @@ record = _ref[boardID]; for (type in record) { id = record[type]; - if ((archive = archives[id]) && __indexOf.call((type === 'file' ? archive['file'] : archive['boards']), boardID) >= 0) { - o[type][boardID] = archive.data; + if (!((archive = archives[id]))) { + continue; } + boards = type === 'file' ? archive.file : archive.boards; + if (__indexOf.call(boards, boardID) < 0) { + continue; + } + o[type][boardID] = archive.data; } } for (name in archives) { diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index d57ccf08e..5ac5b80db 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -9,7 +9,9 @@ Redirect = {archives} = Redirect for boardID, record of Conf['selectedArchives'] - for type, id of record when (archive = archives[id]) and boardID in (if type is 'file' then archive['file'] else archive['boards']) + for type, id of record when (archive = archives[id]) + boards = if type is 'file' then archive.file else archive.boards + continue unless boardID in boards o[type][boardID] = archive.data for name, {data, boards, files} of archives