Skip to content

Commit 71e3afc

Browse files
committed
lib/helpers: fix all_groups()
- Don't write to disk, just pipe. - Don't loop, just do all functions. Performance of old implementation on my system: ``` real 0m9.996s user 0m5.318s sys 0m9.126s ``` Performance of new implementation on my system: ``` real 0m0.052s user 0m0.069s sys 0m0.025s ```
1 parent 5e5d0d4 commit 71e3afc

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/helpers.bash

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,7 @@ function all_groups() {
811811
about 'displays all unique metadata groups'
812812
group 'lib'
813813

814-
local func file
815-
file=$(mktemp -t composure.XXXX)
816-
for func in $(_typeset_functions); do
817-
declare -f "$func" | metafor group >> "$file"
818-
done
819-
sort -u "$file"
820-
rm "$file"
814+
declare -f | metafor group | sort -u
821815
}
822816

823817
if ! _command_exists pathmunge; then

0 commit comments

Comments
 (0)