Avoid unnecessary creation of closures when no canceller is given
Jan Sorgalla
9 years ago
22 | 22 |
{
|
23 | 23 |
if (null !== $this->result) {
|
24 | 24 |
return $this->result->then($onFulfilled, $onRejected, $onProgress);
|
|
25 |
}
|
|
26 |
|
|
27 |
if (null === $this->canceller) {
|
|
28 |
return new static($this->resolver($onFulfilled, $onRejected, $onProgress));
|
25 | 29 |
}
|
26 | 30 |
|
27 | 31 |
$this->requiredCancelRequests++;
|