develooper Front page | perl.perl5.changes | Postings from August 2022

[Perl/perl5] 5aaf02: Perl_reg_named_buff_fetch - simpler retarraycreat...

From:
Richard Leach via perl5-changes
Date:
August 2, 2022 05:58
Subject:
[Perl/perl5] 5aaf02: Perl_reg_named_buff_fetch - simpler retarraycreat...
Message ID:
Perl/perl5/push/refs/heads/blead/414f14-5aaf02@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 5aaf02785ac2afc87abd458c0e6469818cc28775
      https://github.com/Perl/perl5/commit/5aaf02785ac2afc87abd458c0e6469818cc28775
  Author: Richard Leach <richardleach@users.noreply.github.com>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  Perl_reg_named_buff_fetch - simpler retarray creation & push

retarray is a straightforward array created and populated with
SvIVX(sv_dat) number of elements within this function. As the
number of elements is known and all elements will be used, a
correctly-sized array can be created using newAV_alloc_x.

Since it's a straightforward array, av_push_simple can be used in
place of av_push. This will be more efficient.





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About