From c07d39a11f4dde4c6e79e7f266c51ca3bb858902 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 25 Apr 2013 02:23:32 -0700 Subject: [PATCH] Seven is a magic number. --- builds/4chan-X.js | 6 +++++- builds/4chan-X.user.js | 6 +++++- builds/crx/script.js | 6 +++++- src/main.coffee | 5 ++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 216c029ab..e11f52d41 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -9671,7 +9671,11 @@ func = task[0]; args = Array.prototype.slice.call(task, 1); func.apply(func, args); - return setTimeout(softTask, 0); + if ((queue.length % 7) === 0) { + return setTimeout(softTask, 0); + } else { + return softTask(); + } }; len = nodes.length; i = 0; diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 457047733..b9f4b3f1f 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -9694,7 +9694,11 @@ func = task[0]; args = Array.prototype.slice.call(task, 1); func.apply(func, args); - return setTimeout(softTask, 0); + if ((queue.length % 7) === 0) { + return setTimeout(softTask, 0); + } else { + return softTask(); + } }; len = nodes.length; i = 0; diff --git a/builds/crx/script.js b/builds/crx/script.js index c9e41c2b9..27c5834e2 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -9537,7 +9537,11 @@ func = task[0]; args = Array.prototype.slice.call(task, 1); func.apply(func, args); - return setTimeout(softTask, 0); + if ((queue.length % 7) === 0) { + return setTimeout(softTask, 0); + } else { + return softTask(); + } }; len = nodes.length; i = 0; diff --git a/src/main.coffee b/src/main.coffee index 13cca9348..335125b54 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -228,7 +228,10 @@ Main = func = task[0] args = Array::slice.call task, 1 func.apply func, args - setTimeout softTask, 0 + if (queue.length % 7) is 0 + setTimeout softTask, 0 + else + softTask() # get the nodes' length only once len = nodes.length