Skip to content

Commit cf9624c

Browse files
committed
regen/embed.pl: Get rid of ternary
This simple change makes the code a bit easier to understand.
1 parent a55c9f7 commit cf9624c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

regen/embed.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,14 @@ sub generate_proto_h {
371371
foreach my $ix (0..$#names_of_nn) {
372372
push @asserts, "assert($names_of_nn[$ix])";
373373
}
374+
374375
foreach (@typed_args) {
375376
my ($argtype, $argname) = @$_;
376377
my $nullok = !grep { $_ eq $argname } @names_of_nn;
377378
my $type_assert =
378379
$type_asserts{$argtype} =~ s/__arg__/$argname/gr;
379-
push @asserts,
380-
$nullok ? "assert(!$argname || $type_assert)"
381-
: "assert($type_assert)";
380+
$type_assert = "!$argname || $type_assert" if $nullok;
381+
push @asserts, "assert($type_assert)";
382382
}
383383

384384
my $line = "";

0 commit comments

Comments
 (0)