Skip to content

Commit

Permalink
Speed up which by avoiding a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
tribut authored and RichiH committed Nov 29, 2015
1 parent d5c11e4 commit f208e3d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions vcsh
Expand Up @@ -427,9 +427,7 @@ use() {
which() {
[ -e "$VCSH_COMMAND_PARAMETER" ] || fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1
for VCSH_REPO_NAME in $(list); do
for VCSH_FILE in $(get_files); do
echo "$VCSH_FILE" | grep -q "$VCSH_COMMAND_PARAMETER" && echo "$VCSH_REPO_NAME: $VCSH_FILE"
done
get_files | grep -- "$VCSH_COMMAND_PARAMETER" | sed "s/^/$VCSH_REPO_NAME: /"
done | sort -u
}

Expand Down

0 comments on commit f208e3d

Please sign in to comment.