Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: f92d61a1262b859dda4e66f6e315e49494ecdba9
      
https://github.com/Perl/perl5/commit/f92d61a1262b859dda4e66f6e315e49494ecdba9
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  S_find_locale_from_environment(): Change var name

This variable is really the LANG environment variable; change its name
to correspond.


  Commit: 5464381209a433b4f1e255c55d9fbcfda9701552
      
https://github.com/Perl/perl5/commit/5464381209a433b4f1e255c55d9fbcfda9701552
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  S_find_locale_from_environment(): Add comments


  Commit: b78c98a142651aa1dbc3e23ed48436fdb12ea1d7
      
https://github.com/Perl/perl5/commit/b78c98a142651aa1dbc3e23ed48436fdb12ea1d7
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-08-19 (Sat, 19 Aug 2023)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  S_find_locale_from_environment(): Combine logic

Prior to this commit, the logic was repeated for non-LC_ALL versus
LC_ALL; the latter being executed in a loop.  The logic is not really
trivial and it would be better to have just one instance, so that it
can't get out-of-sync.  To do this, this commit moves everything to the
loop, but sets it up for the non-LC_ALL case to just do a single
iteration.

It also avoids going out to the environment and fetching LANG unless
needed.  The previous behavior got LANG unconditionally if the loop was
used.  It is quite likely that not every locale category would have a
corresponding environment variable set, so that fetch likely wasn't
wasted.  But in order to combine things, the checking for LANG is done
in the loop.

The bottom line is that there is extra code required to combine the two
pieces of logic, but I believe the combining of this into a single
paradigm is worth it.


Compare: https://github.com/Perl/perl5/compare/09928a4a740d...b78c98a14265

Reply via email to