aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-19 18:09:31 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-19 18:09:31 +0100
commitea5cad2a0dc7ebbb7de0d1d49ae2b72e6fbd163a (patch)
tree4bae45d92df1d1b90cc391e1986c054a13dd178a /miscutils
parenteac0de55d69a4eea87689c1d4800eb8e80824aca (diff)
downloadbusybox-w32-ea5cad2a0dc7ebbb7de0d1d49ae2b72e6fbd163a.tar.gz
busybox-w32-ea5cad2a0dc7ebbb7de0d1d49ae2b72e6fbd163a.tar.bz2
busybox-w32-ea5cad2a0dc7ebbb7de0d1d49ae2b72e6fbd163a.zip
bc: avoid bc_vec_item() calls in bc_vm_run()
function old new delta bc_vm_run 124 112 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/bc.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 01442c33b..c1601a3e4 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -6926,6 +6926,7 @@ static const char bc_lib[] ALIGN1 = {
6926 6926
6927static BC_STATUS zbc_vm_exec(void) 6927static BC_STATUS zbc_vm_exec(void)
6928{ 6928{
6929 char **fname;
6929 BcStatus s; 6930 BcStatus s;
6930 size_t i; 6931 size_t i;
6931 6932
@@ -6941,13 +6942,16 @@ static BC_STATUS zbc_vm_exec(void)
6941#endif 6942#endif
6942 6943
6943 s = BC_STATUS_SUCCESS; 6944 s = BC_STATUS_SUCCESS;
6944 for (i = 0; !s && i < G.files.len; ++i) 6945 fname = (void*)G.files.v;
6945 s = zbc_vm_file(*((char **) bc_vec_item(&G.files, i))); 6946 for (i = 0; i < G.files.len; i++) {
6946 if (ENABLE_FEATURE_CLEAN_UP && s && !G_ttyin) { 6947 s = zbc_vm_file(*fname++);
6947 // Debug config, non-interactive mode: 6948 if (ENABLE_FEATURE_CLEAN_UP && !G_ttyin && s) {
6948 // return all the way back to main. 6949 // Debug config, non-interactive mode:
6949 // Non-debug builds do not come here, they exit. 6950 // return all the way back to main.
6950 RETURN_STATUS(s); 6951 // Non-debug builds do not come here
6952 // in non-interactive mode, they exit.
6953 RETURN_STATUS(s);
6954 }
6951 } 6955 }
6952 6956
6953 if (IS_BC || (option_mask32 & BC_FLAG_I)) 6957 if (IS_BC || (option_mask32 & BC_FLAG_I))