diff options
-rwxr-xr-x | bin/repos | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -67,6 +67,7 @@ array_decode() { # +# CAVEAT: # To avoid needing to keep decoding the array elements on every call to # `arr_includes`, assume directory names don't contain newlines. This makes the # current code scanning ~/dev/ from 8 seconds go to 1 second. @@ -78,14 +79,14 @@ arr_push() { if [ -n "$ARR" ]; then echo "$ARR" fi - echo "$ELT" # | array_encode + echo "$ELT" # | array_encode (see CAVEAT) } arr_includes() { ARR="$1" ELT="$2" echo "$ARR" | while read -r el; do - # if [ "$(printf '%s\n' "$el" | array_decode)" = "$ELT" ]; then + # if [ "$(printf '%s\n' "$el" | array_decode)" = "$ELT" ]; then (see CAVEAT) if [ "$el" = "$ELT" ]; then return 2 fi |