From 2ef1782bbce15f81b4087d07abe33ef006e7c02d Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Tue, 6 Aug 2013 14:22:13 -0700 Subject: [PATCH] node: remove domain nextTick It's ridiculously cheap to check if process.domain is set. Don't bother cluttering the code. --- src/node.cc | 8 -------- src/node.js | 15 ++++----------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/node.cc b/src/node.cc index a1e3fea919..bb3ab87a8d 100644 --- a/src/node.cc +++ b/src/node.cc @@ -910,20 +910,12 @@ void SetupDomainUse(const FunctionCallbackInfo& args) { Local process = PersistentToLocal(node_isolate, process_p); Local tdc_v = process->Get(FIXED_ONE_BYTE_STRING(node_isolate, "_tickDomainCallback")); - Local ndt_v = - process->Get(FIXED_ONE_BYTE_STRING(node_isolate, "_nextDomainTick")); if (!tdc_v->IsFunction()) { fprintf(stderr, "process._tickDomainCallback assigned to non-function\n"); abort(); } - if (!ndt_v->IsFunction()) { - fprintf(stderr, "process._nextDomainTick assigned to non-function\n"); - abort(); - } Local tdc = tdc_v.As(); - Local ndt = ndt_v.As(); process->Set(FIXED_ONE_BYTE_STRING(node_isolate, "_tickCallback"), tdc); - process->Set(FIXED_ONE_BYTE_STRING(node_isolate, "nextTick"), ndt); process_tickCallback.Reset(node_isolate, tdc); } diff --git a/src/node.js b/src/node.js index f5411cffdd..0652bdf726 100644 --- a/src/node.js +++ b/src/node.js @@ -330,7 +330,6 @@ process.nextTick = nextTick; // needs to be accessible from cc land - process._nextDomainTick = _nextDomainTick; process._tickCallback = _tickCallback; process._tickDomainCallback = _tickDomainCallback; @@ -415,16 +414,10 @@ if (process._exiting) return; - nextTickQueue.push({ callback: callback, domain: null }); - infoBox[length]++; - } - - function _nextDomainTick(callback) { - // on the way out, don't bother. it won't get fired anyway. - if (process._exiting) - return; - - nextTickQueue.push({ callback: callback, domain: process.domain }); + nextTickQueue.push({ + callback: callback, + domain: process.domain || null + }); infoBox[length]++; } };