Summary
Several functions append array elements one at a time via a per-element eval call inside a loop, instead of building a local array once and publishing it with a single eval.
Details
lib/bash/list/lib_list.sh:57-64 (base_list_prepend), :80-89 (base_list_remove), :121-132 (base_list_unique)
lib/bash/arg/lib_arg.sh:259-262, :277-280 (base_arg_parse positional/repeatable publish)
base_list_append already does this correctly with one eval at lib_list.sh:39.
Impact
For large lists/positional counts, this multiplies parse/eval overhead needlessly compared to the single-eval pattern already used elsewhere in the same file.
Suggested fix
Accumulate into a local array first, then do one eval "$name=(\"\${local_array[@]}\")" per target, mirroring base_list_append's pattern.
Summary
Several functions append array elements one at a time via a per-element
evalcall inside a loop, instead of building a local array once and publishing it with a singleeval.Details
lib/bash/list/lib_list.sh:57-64(base_list_prepend),:80-89(base_list_remove),:121-132(base_list_unique)lib/bash/arg/lib_arg.sh:259-262,:277-280(base_arg_parsepositional/repeatable publish)base_list_appendalready does this correctly with oneevalatlib_list.sh:39.Impact
For large lists/positional counts, this multiplies parse/eval overhead needlessly compared to the single-eval pattern already used elsewhere in the same file.
Suggested fix
Accumulate into a local array first, then do one
eval "$name=(\"\${local_array[@]}\")"per target, mirroringbase_list_append's pattern.