summaryrefslogtreecommitdiff
path: root/regen/mk_invlists.pl
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-04-17 14:46:44 +0200
committerKarl Williamson <khw@cpan.org>2022-04-19 05:41:19 -0600
commit44a605b000708fc84ba34c075bc6ba3bb6a3d36d (patch)
treee1d11f64626eaf17d85217cdd52eb3035a52a6d1 /regen/mk_invlists.pl
parent19ad8281cb889184f365a02bd4c1193d351cc418 (diff)
downloadperl-44a605b000708fc84ba34c075bc6ba3bb6a3d36d.tar.gz
regen/mph.pl & mk_invlists.pl - convert from sub interfaces to OO interfaces
The old sub based API was passing around an awkward number of arguments and it was becoming difficult to enhance in certain ways. This patch changes all the "user servicable" functions into methods, and moves the configuration defaults into the constructor. Note, not all the functions have been converted, the core routines with simple interfaces have not been changed. This is OO for the purpose of encapsulation not inheritance or overloading.
Diffstat (limited to 'regen/mk_invlists.pl')
-rw-r--r--regen/mk_invlists.pl13
1 files changed, 7 insertions, 6 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index e5259aa118..c2e7535ceb 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -3367,12 +3367,13 @@ my $keywords_fh = open_new('uni_keywords.h', '>',
print $keywords_fh "\n#if defined(PERL_CORE) || defined(PERL_EXT_RE_BUILD)\n\n";
-my ($second_level, $seed1, $length_all_keys, $smart_blob, $rows)
- = MinimalPerfectHash::make_mph_from_hash(\%keywords);
-print $keywords_fh MinimalPerfectHash::make_algo($second_level, $seed1,
- $length_all_keys, $smart_blob,
- $rows, undef, undef, undef,
- 'match_uniprop' );
+my $mph= MinimalPerfectHash->new(
+ source_hash => \%keywords,
+ match_name => "match_uniprop",
+);
+$mph->make_mph_with_split_keys();
+print $keywords_fh $mph->make_algo();
+
print $keywords_fh "\n#endif /* #if defined(PERL_CORE) || defined(PERL_EXT_RE_BUILD) */\n";
push @sources, 'regen/mph.pl';