Skip to content

Commit 66acc33

Browse files
authored
Merge pull request #49 from Cosmologist/patch-1
Simple optimization of to array casting
2 parents e83bd56 + 60ac90f commit 66acc33

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Image.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,9 +1646,7 @@ public function bandjoin($other, array $options = []): Image
16461646
{
16471647
/* Allow a single unarrayed value as well.
16481648
*/
1649-
if (!is_array($other)) {
1650-
$other = [$other];
1651-
}
1649+
$other = (array) $other;
16521650

16531651
/* If $other is all numbers, we can use self::bandjoin_const().
16541652
*/
@@ -1712,9 +1710,7 @@ public function bandrank($other, array $options = []): Image
17121710

17131711
/* Allow a single unarrayed value as well.
17141712
*/
1715-
if (!is_array($other)) {
1716-
$other = [$other];
1717-
}
1713+
$other = (array) $other;
17181714

17191715
return self::call('bandrank', $this, $other, $options);
17201716
}

0 commit comments

Comments
 (0)