diff options
author | Karl Williamson <khw@cpan.org> | 2020-06-20 16:15:49 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-07-17 22:04:08 -0600 |
commit | 6cf3d06e0804e9d631924758f1257796e63dd66a (patch) | |
tree | 099d2d9d8470b2013645ebde4f88501baa79cf54 /util.c | |
parent | 2de4377139a0fa7eae83af89fefb1e39a1da7908 (diff) | |
download | perl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 */ |