Skip to content

Commit 18bd6b9

Browse files
committed
Remove un-needed default set for predicate
1 parent 35dfa27 commit 18bd6b9

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

src/Collection/filter.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@
5151
*/
5252
function filter(iterable $array, $predicate = null): array
5353
{
54-
if (null === $predicate) {
55-
$predicate = '_\identity';
56-
}
57-
5854
$iteratee = baseIteratee($predicate);
5955

6056
$result = \array_filter(

src/Collection/find.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@
5353
*/
5454
function find(iterable $collection, $predicate = null, int $fromIndex = 0)
5555
{
56-
if (null === $predicate) {
57-
$predicate = '_\identity';
58-
}
59-
6056
$iteratee = baseIteratee($predicate);
6157

6258
foreach (\array_slice($collection, $fromIndex) as $key => $value) {

src/Collection/findLast.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
*/
3131
function findLast(iterable $collection, $predicate = null, int $fromIndex = 0)
3232
{
33-
if (null === $predicate) {
34-
$predicate = '_\identity';
35-
}
36-
3733
$iteratee = baseIteratee($predicate);
3834

3935
foreach (\array_slice(\array_reverse($collection, true), $fromIndex) as $key => $value) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy