From 21f1fd0604f2a77d4cf5177322f65493c8a60f1f Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 6 Oct 2023 17:51:42 -0400 Subject: [PATCH] Simplify get_label() and get_frame_id() Remove return values. --- fgen.sh | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/fgen.sh b/fgen.sh index 45b3001..6e66b49 100755 --- a/fgen.sh +++ b/fgen.sh @@ -50,27 +50,16 @@ function get_pos() # Arg1: line function get_label() { - frame=$(echo "${1}" | ${SED} "s/.*label:\(.*\),geometry.*/\1/g") - - if [ x"${frame}" = x"" ]; then - echo "" - return 1 - else - echo "${frame}" - return 0 - fi + local token + token=$(echo "${1}" | ${SED} "s/.*label:\(.*\),geometry.*/\1/g") + echo "${token}" } # Arg1: line function get_frame_id() { frame=$(echo "${1}" | grep -e "label:[0-9]\+," | ${SED} "s/.*label:\([0-9]\+\),.*/\1/g") - - if [ x"${frame}" = x"" ]; then - echo "" - else - echo "${frame}" - fi + echo "${frame}" } # Arg1: line -- 2.20.1