diff options
author | Yves Orton <demerphq@gmail.com> | 2022-04-14 06:18:48 +0200 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-04-19 05:41:19 -0600 |
commit | 2cba836215fb7e9ed9fea15279702dc683b1a088 (patch) | |
tree | 6d1fa3e1d6a4172648481f7e6325deb94bc9883f | |
parent | 7f77d2a8877d421b1922ee416345e83cd3fe0899 (diff) | |
download | perl-2cba836215fb7e9ed9fea15279702dc683b1a088.tar.gz |
regen/mph.pl - bucket info storage: remove 'hash', move 'value' logic
The 'hash' key is totally unused and unneeded so drop it entirely.
The 'value' key can be stored into the bucket info data elsewhere,
strictly speaking it is not needed for the minimal perfect hash
computations, so move it out so that logic can be changed and
simplified in a future patch.
-rw-r--r-- | regen/mph.pl | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/regen/mph.pl b/regen/mph.pl index 5dab25b419..e859d4fbb5 100644 --- a/regen/mph.pl +++ b/regen/mph.pl @@ -122,8 +122,6 @@ sub build_perfect_hash { +{ key => $_, - hash => $key_to_hash->{$_}, - value => $hash->{$_}, seed2 => 0, } } @$keys; @@ -566,6 +564,7 @@ sub make_mph_from_hash { my ($prefix, $suffix)= unpack "A${sp}A*", $key; $bucket_info->{prefix}= $prefix; $bucket_info->{suffix}= $suffix; + $bucket_info->{value}= $hash->{$key}; } my ($rows, $defines, $tests)= build_array_of_struct($second_level, $smart_blob); |