This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Make locale collation predictions adaptive
authorKarl Williamson <khw@cpan.org>
Fri, 13 May 2016 17:32:44 +0000 (11:32 -0600)
committerKarl Williamson <khw@cpan.org>
Tue, 24 May 2016 16:28:38 +0000 (10:28 -0600)
commit17f41037d4817b6618a903e12aa1377ae078f66a
treed782a3e0de1110c764deb7dd62320f41b9319eb3
parent6ddd902ce7b4052f3d48e6dd638d08d705d1ee16
locale.c: Make locale collation predictions adaptive

We try to avoid calling strxfrm() more than needed by predicting its
needed buffer size.  This generally works because the size of the
transformed string is roughly linear with the size of the input string.
But the key word here is "roughly".  This commit changes things, so that
when we guess low, we change the coefficients in the equation to guess
higher the next time.
locale.c