mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
cdump.c (sym_operator_name): narrow scope of local variables
This commit is contained in:
+2
-4
@@ -155,12 +155,10 @@ sym_operator_name(const char *sym_name, mrb_int len)
|
||||
if (operator_table[table_size-1].sym_name_len < len) return NULL;
|
||||
|
||||
mrb_sym start, idx;
|
||||
int cmp;
|
||||
const struct operator_symbol *op_sym;
|
||||
for (start = 0; table_size != 0; table_size/=2) {
|
||||
idx = start+table_size/2;
|
||||
op_sym = &operator_table[idx];
|
||||
cmp = (int)len-(int)op_sym->sym_name_len;
|
||||
const struct operator_symbol *op_sym = &operator_table[idx];
|
||||
int cmp = (int)len-(int)op_sym->sym_name_len;
|
||||
if (cmp == 0) {
|
||||
cmp = memcmp(sym_name, op_sym->sym_name, len);
|
||||
if (cmp == 0) return op_sym->name;
|
||||
|
||||
Reference in New Issue
Block a user