cdump.c (sym_operator_name): narrow scope of local variables

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-03-08 22:53:45 +09:00
parent 3699f013ac
commit 678bdd2c4b
+2 -4
View File
@@ -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;