diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-05-26 12:13:02 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-05-26 12:13:02 -0400 |
commit | 41412a86f2ca0baf908fe0b2e4bcc396f66989ae (patch) | |
tree | 9875cde0dbc0002b7d93e0ca7f61a00db09f36eb /ext.c | |
parent | ec5169b2f883a72dbe7c4515198199674017940a (diff) | |
download | egawk-41412a86f2ca0baf908fe0b2e4bcc396f66989ae.tar.gz egawk-41412a86f2ca0baf908fe0b2e4bcc396f66989ae.tar.bz2 egawk-41412a86f2ca0baf908fe0b2e4bcc396f66989ae.zip |
Optimize API function argument retrieval to eliminate a duplicate call to get_argument.
Diffstat (limited to 'ext.c')
-rw-r--r-- | ext.c | 16 |
1 files changed, 1 insertions, 15 deletions
@@ -334,28 +334,14 @@ get_argument(int i) */ NODE * -get_actual_argument(int i, bool optional, bool want_array) +get_actual_argument(NODE *t, int i, bool optional, bool want_array) { - NODE *t; char *fname; - int pcount; INSTRUCTION *pc; pc = TOP()->code_ptr; /* Op_ext_builtin instruction */ fname = (pc + 1)->func_name; - pcount = (pc + 1)->expr_count; - t = get_argument(i); - if (t == NULL) { - if (i >= pcount) /* must be fatal */ - fatal(_("function `%s' defined to take no more than %d argument(s)"), - fname, pcount); - if (! optional) - fatal(_("function `%s': missing argument #%d"), - fname, i + 1); - return NULL; - } - if (t->type == Node_var_new) { if (want_array) return force_array(t, false); |