Bug 1459035 - micro-optimize refcounting for nsSocket{Input,Output}Stream; r=valentin

This commit is contained in:
Nathan Froyd 2018-05-04 13:52:02 -04:00
parent 753c26dd7e
commit 709477d79d

View File

@ -284,8 +284,7 @@ nsSocketInputStream::OnSocketReady(nsresult condition)
// ignore event if only waiting for closure and not closed.
if (NS_FAILED(mCondition) || !(mCallbackFlags & WAIT_CLOSURE_ONLY)) {
callback = mCallback;
mCallback = nullptr;
callback = mCallback.forget();
mCallbackFlags = 0;
}
}
@ -545,8 +544,7 @@ nsSocketOutputStream::OnSocketReady(nsresult condition)
// ignore event if only waiting for closure and not closed.
if (NS_FAILED(mCondition) || !(mCallbackFlags & WAIT_CLOSURE_ONLY)) {
callback = mCallback;
mCallback = nullptr;
callback = mCallback.forget();
mCallbackFlags = 0;
}
}