Skip to content

Commit

Permalink
Perl_class_wrap_method_body: simple push to newly-created AV
Browse files Browse the repository at this point in the history
Since the AV has just been created and is simple in nature, there's
no need to do a full-blown `av_push`.

Technically, that's still overkill. Simplification could be taken
further by creating the `fieldmap` AV with `PadnamelistMAX(pnl) - 2`
items (when that is a >0 value), then directly assigning values into
elements. But it's not clear (to me) if that would be worth doing.
  • Loading branch information
richardleach authored and leonerd committed Sep 6, 2023
1 parent c0c43c4 commit f357b86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions class.c
Expand Up @@ -857,8 +857,8 @@ Perl_class_wrap_method_body(pTHX_ OP *o)
if(fieldix > max_fieldix)
max_fieldix = fieldix;

av_push(fieldmap, newSVuv(padix));
av_push(fieldmap, newSVuv(fieldix));
av_push_simple(fieldmap, newSVuv(padix));
av_push_simple(fieldmap, newSVuv(fieldix));
}

UNOP_AUX_item *aux = NULL;
Expand Down

0 comments on commit f357b86

Please sign in to comment.