This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid locale function overhead
authorKarl Williamson <khw@cpan.org>
Sun, 1 Jun 2014 19:42:31 +0000 (13:42 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 5 Jun 2014 17:23:00 +0000 (11:23 -0600)
commit8d98ede7e1cbbb475ae22272175fac5115496ffa
treebbb01277d1cc76a91b95ba3754543c7049414be5
parent5f1269ab079ccc53073681a4adc4f6cf92114d91
Avoid locale function overhead

For the LC_NUMERIC locale category, one can swap between setlocale being
to "C" or to the underlying locale.  Perl keeps track of the state
using two boolean variables.  By testing these before calling the swap
functions, we can skip calling them if the current state is the one we
want to be in, and avoid the function call overhead, as the function
becomes a no-op if the current state is the desired one.
perl.h