From: Eugene Syromyatnikov Date: Tue, 5 Feb 2019 23:49:47 +0000 (+0100) Subject: xlat/gen.sh: speedup, part 5 X-Git-Tag: v5.0~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93adba1582c05fc315ef9060b6d23780d2a76635;p=strace xlat/gen.sh: speedup, part 5 * xlat/gen.sh (gen_header): Process xlat line with sed only when "/*" substring is present in it. Co-Authored-by: Dmitry V. Levin --- diff --git a/xlat/gen.sh b/xlat/gen.sh index 9a9d6222..251b554a 100755 --- a/xlat/gen.sh +++ b/xlat/gen.sh @@ -132,8 +132,12 @@ gen_header() local unconditional= line # 1st pass: output directives. while read line; do - line=$(printf "%s" "$line" | \ - sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||") + case "$line" in + */\**) + line=$(printf "%s" "$line" | + sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||") + ;; + esac case $line in '#stop') @@ -201,8 +205,12 @@ gen_header() unconditional= val_type= # 2nd pass: output everything. while read line; do - line=$(printf "%s" "$line" | \ - sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||") + case "$line" in + */\**) + line=$(printf "%s" "$line" | + sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||") + ;; + esac case ${line} in '#conditional')