unify PERL_HASH and PERL_HASH_INTERNAL
authorDavid Mitchell <davem@iabyn.com>
Thu, 28 Apr 2011 15:33:35 +0000 (16:33 +0100)
committerDavid Mitchell <davem@iabyn.com>
Thu, 19 May 2011 13:49:42 +0000 (14:49 +0100)
commitf8d50d94322d5861315980980d36590a8caca5c6
tree94fd91f4f0dae3deaeae0e6e34dcd79dcad2c0cc
parentafbbf215a9f8470ac637c1eddc1d4f0eaa8ab090
unify PERL_HASH and PERL_HASH_INTERNAL

Those two macros expand into two large, almost identical chunks of code.
The only difference between the two is the source of the hash seed.
So parameterize this into a new PERL_HASH_INTERNAL_() macro.

Also, there are a couple of places in hv.c that do the rough equivalent of

    if (HvREHASH(hv))
key = PERL_HASH_INTERNAL(...)
    else
key = PERL_HASH(...)

which incorporates two complete macro expansions into the code.
Reorganise them to be

    key = PERL_HASH_INTERNAL_(..., HvREHASH(hv))
hv.c
hv.h