From fc979ccde3771526433e40401e938fda45f0e028 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 16 Dec 2016 17:20:25 +1300 Subject: Use loop short-circuit --- mgrep | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mgrep b/mgrep index d57f9b5..aa1196e 100755 --- a/mgrep +++ b/mgrep @@ -87,9 +87,8 @@ done # patterns from it. If it doesn't exist, just continue on. if [[ -e $exclude ]] ; then while read -r exclusion ; do - if [[ $exclusion ]] ; then - find_args=("${find_args[@]}" '!' '-name' "$exclusion") - fi + [[ -n $exclusion ]] || continue + find_args=("${find_args[@]}" '!' '-name' "$exclusion") done < "$exclude" fi -- cgit v1.2.3