mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-16 23:42:45 +08:00
share/config.fish: Skip __fish_set_locale if $LANG is already set
This is the most common and sensible env var, we check it outside, so we can skip loading the function at all if we already know it's not gonna do anything. This is done on every startup of every single fish, and it saves ~0.2ms.
This commit is contained in:
parent
7534572d99
commit
fc95eca257
|
@ -150,7 +150,8 @@ end
|
|||
# Set the locale if it isn't explicitly set. Allowing the lack of locale env vars to imply the
|
||||
# C/POSIX locale causes too many problems. Do this before reading the snippets because they might be
|
||||
# in UTF-8 (with non-ASCII characters).
|
||||
__fish_set_locale
|
||||
not set -q LANG # (fast path - no need to load the file if we have $LANG)
|
||||
and __fish_set_locale
|
||||
|
||||
#
|
||||
# Some things should only be done for login terminals
|
||||
|
|
Loading…
Reference in New Issue
Block a user