diff mbox series

[v2,05/10] generate-cmdlist.sh: run "grep | sort", not "sort | grep"

Message ID patch-v2-05.10-f01c1fd8088-20211022T193027Z-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series Makefile: make generate-cmdlist.sh much faster | expand

Commit Message

Ævar Arnfjörð Bjarmason Oct. 22, 2021, 7:36 p.m. UTC
This doesn't matter for performance, but let's not include the empty
lines in our sorting. This makes the intent of the code clearer.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 generate-cmdlist.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index 16043e38476..e517c33710a 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -18,8 +18,8 @@  category_list () {
 	command_list "$1" |
 	cut -c 40- |
 	tr ' ' '\012' |
-	LC_ALL=C sort -u |
-	grep -v '^$'
+	grep -v '^$' |
+	LC_ALL=C sort -u
 }
 
 get_synopsis () {