Skip to content

Commit bcfaa3e

Browse files
committed
regen/embed.pl: Remove a loop
By creating the @asserts array with each element in its final form, the loop that later did this can be eliminated.
1 parent 5395b0a commit bcfaa3e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

regen/embed.pl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ sub generate_proto_h {
276276

277277
if (defined $argname && (! $has_mflag || $binarycompat)) {
278278
if ($nn||$nz) {
279-
push @asserts, $argname;
279+
push @asserts, "assert($argname)";
280280
}
281281

282282
if ( ! $nocheck
@@ -286,7 +286,7 @@ sub generate_proto_h {
286286
my $type_assert =
287287
$type_asserts{$argtype} =~ s/__arg__/$argname/gr;
288288
$type_assert = "!$argname || $type_assert" if $nullok;
289-
push @asserts, $type_assert;
289+
push @asserts, "assert($type_assert)";
290290
}
291291
}
292292
}
@@ -369,10 +369,6 @@ sub generate_proto_h {
369369
if (@asserts) {
370370
$ret .= " \\\n";
371371

372-
foreach my $assertion (@asserts) {
373-
$assertion = "assert($assertion)";
374-
}
375-
376372
my $line = "";
377373
while(@asserts) {
378374
my $assert = shift @asserts;

0 commit comments

Comments
 (0)