summaryrefslogtreecommitdiff
path: root/regen/mph.pl
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-04-11 12:20:08 +0200
committerKarl Williamson <khw@cpan.org>2022-04-19 05:41:19 -0600
commit3734afdd6313581dd6e3b8139a150e23caf670fd (patch)
tree82253ec9166a550837da57db8bd400bf696784d7 /regen/mph.pl
parent5f0d16f0a3df9d4fe15b3452cabfd81af432ca49 (diff)
downloadperl-3734afdd6313581dd6e3b8139a150e23caf670fd.tar.gz
regen/mph.pl - dont use $key when dealing with $part of a key
In build_split_words() $key is used for the main hash, use $part instead when we are dealing with part of a key (even if the $part might equal the $key).
Diffstat (limited to 'regen/mph.pl')
-rw-r--r--regen/mph.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/regen/mph.pl b/regen/mph.pl
index 85164732be..d99d3230f7 100644
--- a/regen/mph.pl
+++ b/regen/mph.pl
@@ -166,8 +166,8 @@ sub build_split_words {
}
}
- foreach my $key (@{_sort_keys_longest_first(\%parts)}) {
- $blob .= $key . "\0";
+ foreach my $part (@{_sort_keys_longest_first(\%parts)}) {
+ $blob .= $part . "\0";
}
printf "Using preprocessing, initial blob size %d\n", length($blob);
} else {
@@ -233,8 +233,8 @@ sub build_split_words {
$appended{$best_suffix}++;
}
my $b2 = "";
- foreach my $key (@{_sort_keys_longest_first(\%appended)}) {
- $b2 .= $key unless index($b2,$key)>=0;
+ foreach my $part (@{_sort_keys_longest_first(\%appended)}) {
+ $b2 .= $part unless index($b2,$part)>=0;
}
if (length($b2)<length($blob)) {
printf "Length old blob: %d length new blob: %d, recomputing using new blob\n", length($blob),length($b2);