Skip to content

Commit 4fc9ad5

Browse files
committed
Remove always true conditonals in vm_populate_cc
1 parent 7688b05 commit 4fc9ad5

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

vm_insnhelper.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,17 +2156,7 @@ vm_populate_cc(VALUE klass, const struct rb_callinfo * const ci, ID mid)
21562156

21572157
RB_DEBUG_COUNTER_INC(cc_not_found_in_ccs);
21582158

2159-
const rb_callable_method_entry_t *cme;
2160-
2161-
if (ccs) {
2162-
cme = ccs->cme;
2163-
cme = UNDEFINED_METHOD_ENTRY_P(cme) ? NULL : cme;
2164-
2165-
VM_ASSERT(cme == rb_callable_method_entry(klass, mid));
2166-
}
2167-
else {
2168-
cme = rb_callable_method_entry(klass, mid);
2169-
}
2159+
const rb_callable_method_entry_t *cme = rb_callable_method_entry(klass, mid);
21702160

21712161
VM_ASSERT(cme == NULL || IMEMO_TYPE_P(cme, imemo_ment));
21722162

@@ -2180,9 +2170,9 @@ vm_populate_cc(VALUE klass, const struct rb_callinfo * const ci, ID mid)
21802170

21812171
METHOD_ENTRY_CACHED_SET((struct rb_callable_method_entry_struct *)cme);
21822172

2183-
if (ccs == NULL) {
2184-
VM_ASSERT(cc_tbl);
2173+
VM_ASSERT(cc_tbl);
21852174

2175+
{
21862176
VALUE ccs_obj;
21872177
if (UNLIKELY(rb_managed_id_table_lookup(cc_tbl, mid, &ccs_obj))) {
21882178
ccs = (struct rb_class_cc_entries *)ccs_obj;

0 commit comments

Comments
 (0)