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
```
pull/1904/head
John D Pell 2021-09-23 09:55:11 -07:00
parent 5043c78701
commit 7ea6efab3f
1 changed files with 1 additions and 7 deletions

View File

@ -828,13 +828,7 @@ function all_groups() {
about 'displays all unique metadata groups'
group 'lib'
local func file
file=$(mktemp -t composure.XXXX)
for func in $(_typeset_functions); do
declare -f "$func" | metafor group >> "$file"
done
sort -u "$file"
rm "$file"
declare -f | metafor group | sort -u
}
if ! _command_exists pathmunge; then