From: K.Kosako Date: Wed, 11 Apr 2018 05:58:45 +0000 (+0900) Subject: remove some name id value check X-Git-Tag: v6.8.2^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cd5891fd94bbc91a65955d406845133ea45ed58;p=onig remove some name id value check --- diff --git a/src/regparse.c b/src/regparse.c index 50738f1..64923ad 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -1673,38 +1673,24 @@ onig_get_callout_in_by_name_id(int name_id) static int get_callout_arg_num_by_name_id(int name_id) { - if (name_id < 0 || name_id >= GlobalCalloutNameList->n) - return -1; - return GlobalCalloutNameList->v[name_id].arg_num; } static int get_callout_opt_arg_num_by_name_id(int name_id) { - if (name_id < 0 || name_id >= GlobalCalloutNameList->n) - return 0; - return GlobalCalloutNameList->v[name_id].opt_arg_num; } static unsigned int get_callout_arg_type_by_name_id(int name_id, int index) { - if (name_id < 0 || name_id >= GlobalCalloutNameList->n) - return 0; - return GlobalCalloutNameList->v[name_id].arg_types[index]; } static OnigValue get_callout_opt_default_by_name_id(int name_id, int index) { - if (name_id < 0 || name_id >= GlobalCalloutNameList->n) { - OnigValue v; - xmemset(&v, 0, sizeof(v)); - return v; - } return GlobalCalloutNameList->v[name_id].opt_defaults[index]; }