Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: d630fe44d3be7e1d5d3d43bc845d554a6563ed32
      
https://github.com/Perl/perl5/commit/d630fe44d3be7e1d5d3d43bc845d554a6563ed32
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Combine some preprocessor directives

This function is full of #if conditionals, due to the high variance in
what the capabilities of platforms are.

I tried various methods to lessen the cognitive load, like turning it
into separate functions that each suit a particular Configuration, but
it was just as complicated as before.

The code is doing set up, then the actual operation, then teardown.  The
actual operation is invariant.  What this commit does is for some of the
setup conditionals to define its own teardown macro.  The result is the
teardown looks much cleaner, and there is no possibility that it will
get out-of-sync with the setup.

This commit also causes there to be a matching restore for each toggle.
That symmetry will become important for future commits.


Reply via email to