From 0ee7a4ee9d7cffbf714ebd3e9b0d8b42379dfc0b Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Fri, 8 Mar 2024 22:48:02 +0300 Subject: [PATCH] Generate : Small optimization. --- .doc/Generate.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.doc/Generate.sh b/.doc/Generate.sh index fd44a386..3fc77596 100755 --- a/.doc/Generate.sh +++ b/.doc/Generate.sh @@ -31,8 +31,10 @@ echo >> "${file}" # Fill with data. for module in $(find_module); do + functions=($(find_function ${module} )) + # Skip if no functions. - [[ "$(find_function ${module} | /usr/bin/env grep -v ^_)" = "" ]] && continue + [[ "$(printf "%s\n" ${functions[@]} | /usr/bin/env grep -v ^_)" = "" ]] && continue # Print module title. echo "## ${module^}." >> "${file}" @@ -42,7 +44,7 @@ for module in $(find_module); do echo "Command|Description" >> "${file}" echo "---|---" >> "${file}" - for fun in $(find_function ${module}); do + for fun in ${functions[@]}; do # Skip private functions. [[ "${fun}" =~ ^_.* ]] && continue