From ab5dabf876cca785314f198c6e4e47d5a3bcb46a Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Thu, 15 Aug 2013 12:31:38 -0700 Subject: [PATCH] node: remove duplicate infoBox checks These checks are now done in C++ and don't need to also be checked in JS. Also remove a couple unused variables. --- src/node.js | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/src/node.js b/src/node.js index 0652bdf726..fae354b409 100644 --- a/src/node.js +++ b/src/node.js @@ -350,13 +350,8 @@ // run callbacks that have no domain // using domains will cause this to be overridden function _tickCallback() { - var callback, nextTickLength, threw; + var callback, threw; - if (infoBox[inTick] === 1) return; - if (infoBox[length] === 0) { - infoBox[index] = 0; - return; - } infoBox[inTick] = 1; while (infoBox[index] < infoBox[length]) { @@ -374,26 +369,17 @@ } function _tickDomainCallback() { - var nextTickLength, tock, callback; + var tock, callback, domain; - if (infoBox[lastThrew] === 1) { - infoBox[lastThrew] = 0; - return; - } - - if (infoBox[inTick] === 1) return; - if (infoBox[length] === 0) { - infoBox[index] = 0; - return; - } infoBox[inTick] = 1; while (infoBox[index] < infoBox[length]) { tock = nextTickQueue[infoBox[index]++]; callback = tock.callback; - if (tock.domain) { - if (tock.domain._disposed) continue; - tock.domain.enter(); + domain = tock.domain; + if (domain) { + if (domain._disposed) continue; + domain.enter(); } infoBox[lastThrew] = 1; try { @@ -402,8 +388,8 @@ } finally { if (infoBox[lastThrew] === 1) tickDone(); } - if (tock.domain) - tock.domain.exit(); + if (domain) + domain.exit(); } tickDone();