On Fri, Aug 09, 2024 at 04:35:32PM +0100, Richard Sandiford wrote: > > But what I mean is: the code could just be: > > od = lookup_operand_data (&d->operand[0]); > /* Brute force substring search. */ > for (; od; od = od->eq_next) > { > i = 1; > while (1) > { > if (i == d->n_operands) > goto full_match; > if (od2 == NULL) > goto partial_match; > if (! compare_operands (od2, &d->operand[i])) > break; > ++i, od2 = od2->next; > } > } > i = 0; > > /* Either partial match at the end of the list, or no match. In either > case, we tack on what operands are remaining to the end of the list. */ > partial_match: > ... > > full_match: > ... > > Each partial and full match starts at index 1, because the hash > table guarantees a match for index 0. partial_match is entered > with i == 0 iff this is an entirely new entry. > > Thanks, > Richard >
Thank you for your detailed explanation. BR, Xianmiao