From da5c2c6486850e7319ff2fca0c876ab86e42ed3a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 27 Oct 2022 22:52:29 -0300 Subject: bin/repos: Add explicit note on intentionally commented code --- bin/repos | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/repos b/bin/repos index 2d95410..1e764ca 100755 --- a/bin/repos +++ b/bin/repos @@ -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 -- cgit v1.2.3