Browse Source

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 <tjfontaine@gmail.com>
v0.11.11-release
Trevor Norris 11 years ago
parent
commit
bf08ac462e
  1. 6
      src/node.js

6
src/node.js

@ -564,7 +564,7 @@
var inQueue = false; var inQueue = false;
// The asyncQueue will be small. Probably always <= 3 items. // The asyncQueue will be small. Probably always <= 3 items.
for (var i = 0; i < asyncQueue.length; i++) { for (var i = 0; i < asyncQueue.length; i++) {
if (callbacks.uid === asyncQueue[i].uid) { if (callbacks === asyncQueue[i]) {
inQueue = true; inQueue = true;
break; break;
} }
@ -585,7 +585,7 @@
if (asyncQueue) { if (asyncQueue) {
for (i = 0; i < asyncQueue.length; i++) { for (i = 0; i < asyncQueue.length; i++) {
if (obj.uid === asyncQueue[i].uid) { if (obj === asyncQueue[i]) {
asyncQueue.splice(i, 1); asyncQueue.splice(i, 1);
break; break;
} }
@ -597,7 +597,7 @@
if (asyncStack[i] === undefined) if (asyncStack[i] === undefined)
continue; continue;
for (j = 0; j < asyncStack[i].length; j++) { 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); asyncStack[i].splice(j, 1);
break; break;
} }

Loading…
Cancel
Save