From bf08ac462e2c706aa4a5da7e8363f6e66c5d18c9 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Tue, 21 Jan 2014 09:22:00 -0800 Subject: [PATCH] node: compare AsyncListener instances, not uid's Now that process.createAsyncListener() returns a unique object instance it is no longer necessary to compare the uid's of the objects. Signed-off-by: Timothy J Fontaine --- src/node.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node.js b/src/node.js index 6599a2ae744..31c0e1b82e5 100644 --- a/src/node.js +++ b/src/node.js @@ -564,7 +564,7 @@ var inQueue = false; // The asyncQueue will be small. Probably always <= 3 items. for (var i = 0; i < asyncQueue.length; i++) { - if (callbacks.uid === asyncQueue[i].uid) { + if (callbacks === asyncQueue[i]) { inQueue = true; break; } @@ -585,7 +585,7 @@ if (asyncQueue) { for (i = 0; i < asyncQueue.length; i++) { - if (obj.uid === asyncQueue[i].uid) { + if (obj === asyncQueue[i]) { asyncQueue.splice(i, 1); break; } @@ -597,7 +597,7 @@ if (asyncStack[i] === undefined) continue; for (j = 0; j < asyncStack[i].length; j++) { - if (obj.uid === asyncStack[i][j].uid) { + if (obj === asyncStack[i][j]) { asyncStack[i].splice(j, 1); break; }