2 ms·
I've seen this referred to as the "goes-to" operator: size_t i = num_burritos; while (i --> 0) // Read: while 'i' goes to zero
by efaref 11y ago
I've seen this referred to as the "goes-to" operator:
size_t i = num_burritos;
while (i --> 0) // Read: while 'i' goes to zero
if (want_burrito(i))
break;
While it sounds nice, I don't think it's a good idea.
Clearly the correct solution is to use a better language, e.g.:
return next((burrito for burrito in reversed(burritos) if burrito.wanted()), None)