Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: abf1aa2b099b9613c2e6901d3f61eb8da735d934 https://github.com/Perl/perl5/commit/abf1aa2b099b9613c2e6901d3f61eb8da735d934 Author: Paul "LeoNerd" Evans <leon...@leonerd.org.uk> Date: 2022-12-19 (Mon, 19 Dec 2022)
Changed paths: M embed.h M ext/Opcode/Opcode.pm M lib/B/Op_private.pm M op.c M opcode.h M opnames.h M pp.c M pp_proto.h M proto.h M regen/op_private M regen/opcodes Log Message: ----------- Define OP_HELEMEXISTSOR, a handy LOGOP shortcut for HELEM existence tests This op is constructed using an OP_HELEM as the op_first and any scalar expression as the op_other. It is roughly equivalent to the following perl code: exists $hv{$key} ? $hv{$key} : OTHER except that the HV and the KEY expression are evaluated only once, and only one hv_* function is invoked to both test and obtain the value. It is therefore smaller and more efficient. Likewise, adding the OPpHELEMEXISTSOR_DELETE flag turns it into the equivalent of exists $hv{$key} ? delete $hv{$key} : OTHER