Skip to content

Commit bcdad75

Browse files
committed
improve stack performance
1 parent 70004b6 commit bcdad75

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/Middleware/Stack.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ public function __construct(
1616

1717
public function next(): Middleware
1818
{
19-
$next = $this->middlewares[$this->index] ?? null;
20-
21-
if ($next === null) {
22-
throw new NoMoreMiddleware();
23-
}
24-
25-
$this->index++;
26-
27-
return $next;
19+
return $this->middlewares[$this->index++] ?? throw new NoMoreMiddleware();
2820
}
2921
}

0 commit comments

Comments
 (0)