This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
gv.c: rework special var matching logic to be simpler
authorYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 09:09:00 +0000 (11:09 +0200)
committerYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 11:28:01 +0000 (13:28 +0200)
commiteafd371ce091bf61fe1673448eee5e53c4b0ef32
treeed169b5f582dff499ed2afd92adb289d5ef4418e
parent9b7f107c71adc4ec97fdd079ad9cb52f2f5b1f16
gv.c: rework special var matching logic to be simpler

The old code used a bunch of tricks that IMO are unlikely
to actually make any performance difference, and make
the code harder to read, search, and understand, and less
amenable to using string constant friendly macros.

So for instance instead of switching on the first char
and then comparing the second on for an exact match
instead just compare the full string. The extra char
is unlikely to make a difference to the underlying code
that gets called, and the end result is easier searching.

Another issue is that some of the code was inadverdantly
doing prefix matches, and not exact matchs for certain
magic var names. This is fixed as part of these changes.
gv.c