bc: speed up string printing, fix print ""

function                                             old     new   delta
static.esc                                             -       9      +9
zxc_program_print                                    681     683      +2
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 11/0)               Total: 11 bytes
   text	   data	    bss	    dec	    hex	filename
 979144	    485	   7296	 986925	  f0f2d	busybox_old
 979062	    485	   7296	 986843	  f0edb	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2019-01-02 05:03:53 +01:00
parent 2231468a2f
commit 266bec8ba7
2 changed files with 28 additions and 44 deletions

View File

@@ -149,6 +149,12 @@ testing "bc (!a&&b)" \
"0\n" \
"" "(!a&&b)"
# check that dc code is not messing this up (no NUL printing!)
testing "bc print \"\"" \
"bc" \
"" \
"" "print \"\""
testing "bc print 1,2,3" \
"bc" \
"123" \