Skip to content

Commit 6a1159e

Browse files
committed
Micro-optimization
1 parent e179cf8 commit 6a1159e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/functions.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ function location(Field $field): string
4444

4545
function has_value(array $data, Field $field): bool
4646
{
47-
$location = location($field);
48-
49-
return array_key_exists($location, $data) && array_key_exists($field->name, $data[$location]);
47+
return array_key_exists($field->name, $data[location($field)] ?? []);
5048
}
5149

5250
function get_value(array $data, Field $field)

0 commit comments

Comments
 (0)