Skip to content

Commit

Permalink
Before filling the lookup hash for opcode names, pre-expand it.
Browse files Browse the repository at this point in the history
We know the size needed (about 400 entries), so doing this saves several
automatic resizes when populating it.
  • Loading branch information
nwc10 committed Aug 21, 2021
1 parent 03a62b1 commit 25c7a49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/Opcode/Opcode.pm
Expand Up @@ -6,7 +6,7 @@ use strict;

our($VERSION, @ISA, @EXPORT_OK);

$VERSION = "1.53";
$VERSION = "1.54";

use Carp;
use Exporter 'import';
Expand Down
1 change: 1 addition & 0 deletions ext/Opcode/Opcode.xs
Expand Up @@ -55,6 +55,7 @@ op_names_init(pTHX)
dMY_CXT;

op_named_bits = newHV();
hv_ksplit(op_named_bits, PL_maxo);
op_names = get_op_names();
for(i=0; i < PL_maxo; ++i) {
SV * const sv = newSViv(i);
Expand Down

0 comments on commit 25c7a49

Please sign in to comment.