Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
582d2d6
commit 363fa93
Showing
1 changed file
with
67 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters