diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-21 16:05:26 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-21 16:05:26 +1200 |
commit | 2fbbad98b859c052450dc4df40bb336b5896833b (patch) | |
tree | d64c10fcf827af97a7f756316e726f0bb49a22cb /bash | |
parent | Add basic version check to bash_logout (diff) | |
download | dotfiles-2fbbad98b859c052450dc4df40bb336b5896833b.tar.gz dotfiles-2fbbad98b859c052450dc4df40bb336b5896833b.zip |
Remove subshell call from status print
Slightly but consistently faster
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 12d8ab04..f008cf11 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -103,8 +103,8 @@ prompt() { fi # Print the status in brackets with a git: prefix - printf '(git:%s%s)' \ - "${branch:-unknown}" "$(printf %s "${state[@]}")" + local IFS= + printf '(git:%s%s)' "${branch:-unknown}" "${state[*]}" ;; # Mercurial prompt function @@ -130,8 +130,8 @@ prompt() { fi # Print the status in brackets with an hg: prefix - printf '(hg:%s%s)' \ - "${branch:-unknown}" "$(printf %s "${state[@]}")" + local IFS= + printf '(hg:%s%s)' "${branch:-unknown}" "${state[*]}" ;; # Subversion prompt function @@ -197,8 +197,8 @@ prompt() { fi # Print the state in brackets with an svn: prefix - printf '(svn:%s%s)' \ - "${branch:-unknown}" "$(printf %s "${state[@]}")" + local IFS= + printf '(svn:%s%s)' "${branch:-unknown}" "${state[*]}" ;; # VCS wrapper prompt function; print the first relevant prompt, if any |