mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-23 11:29:01 +00:00
[bash] Don’t print function definition when checking for existence (#3448)
When just checking whether a function is already defined or not, it’s not necessary to print out it’s definition (should it be defined). bash’s `declare` provides the `-F`-option (which implies `-f`), which should give a minor performance improvement Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
This commit is contained in:
parent
ee4ba104e7
commit
e833823e15
@ -12,7 +12,7 @@
|
|||||||
if [[ $- =~ i ]]; then
|
if [[ $- =~ i ]]; then
|
||||||
|
|
||||||
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
|
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
|
||||||
if ! declare -f _fzf_compgen_path > /dev/null; then
|
if ! declare -F _fzf_compgen_path > /dev/null; then
|
||||||
_fzf_compgen_path() {
|
_fzf_compgen_path() {
|
||||||
echo "$1"
|
echo "$1"
|
||||||
command find -L "$1" \
|
command find -L "$1" \
|
||||||
@ -21,7 +21,7 @@ if ! declare -f _fzf_compgen_path > /dev/null; then
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! declare -f _fzf_compgen_dir > /dev/null; then
|
if ! declare -F _fzf_compgen_dir > /dev/null; then
|
||||||
_fzf_compgen_dir() {
|
_fzf_compgen_dir() {
|
||||||
command find -L "$1" \
|
command find -L "$1" \
|
||||||
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \
|
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \
|
||||||
|
Loading…
Reference in New Issue
Block a user