aboutsummaryrefslogtreecommitdiff
path: root/bin/repos
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-10-27 22:52:29 -0300
committerEuAndreh <eu@euandre.org>2022-10-27 22:52:29 -0300
commitda5c2c6486850e7319ff2fca0c876ab86e42ed3a (patch)
tree21368e5a0cd8d5d8a77a218825d6e4cd8435f0f7 /bin/repos
parentbin/repos: Add documentation for -e option in help string (diff)
downloaddotfiles-da5c2c6486850e7319ff2fca0c876ab86e42ed3a.tar.gz
dotfiles-da5c2c6486850e7319ff2fca0c876ab86e42ed3a.tar.xz
bin/repos: Add explicit note on intentionally commented code
Diffstat (limited to 'bin/repos')
-rwxr-xr-xbin/repos5
1 files 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