Skip to content

Conversation

@Ayoub-Mabrouk
Copy link
Contributor

Replace filter()->isEmpty() with contains() for better performance. The contains() method short-circuits on first match and doesn't create new Collection objects, improving time complexity from O(n) to O(k) where k is the match position.

Ayoub-Mabrouk and others added 4 commits November 28, 2025 01:33
Replace filter()->isEmpty() with contains() for better performance. The contains() method short-circuits on first match and doesn't create new Collection objects, improving time complexity from O(n) to O(k) where k is the match position.
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@taylorotwell taylorotwell merged commit 94ea19c into laravel:2.x Nov 28, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants