summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-06-20 16:15:49 -0600
committerKarl Williamson <khw@cpan.org>2020-07-17 22:04:08 -0600
commit6cf3d06e0804e9d631924758f1257796e63dd66a (patch)
tree099d2d9d8470b2013645ebde4f88501baa79cf54 /util.c
parent2de4377139a0fa7eae83af89fefb1e39a1da7908 (diff)
downloadperl-6cf3d06e0804e9d631924758f1257796e63dd66a.tar.gz
Remove EBCDIC PL_freq
Instead, do a translation of the ASCII one at runtime. This is because the table doesn't account for the various EBCDIC flavors, so isn't actually accurate.
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index 9aa8f5531f..4b6c0dfcfa 100644
--- a/util.c
+++ b/util.c
@@ -772,9 +772,10 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags)
s = (const unsigned char*)(SvPVX_const(sv)); /* deeper magic */
for (i = 0; i < len; i++) {
- if (PL_freq[s[i]] < frequency) {
+ U32 this_frequency = PL_freq[NATIVE_TO_LATIN1(s[i])];
+ if (this_frequency < frequency) {
PERL_DEB( rarest = i );
- frequency = PL_freq[s[i]];
+ frequency = this_frequency;
}
}
BmUSEFUL(sv) = 100; /* Initial value */