I have a list that I want to compare a value against to determine the value's "rank", the problem is that once I have determined the rank I wish to end the search... In ASM this is easy (please bare with my half remembered 68k):
_start move.l _number,d0
cmpi.l #4185,d0
blt.s _case4184
cmpi.l #4507,d0
blt.s _case4507
cmpi.l #4883,d0
blt.s _case4883
cmpi.l #5327,d0
blt.s _case5327
move.l 0,d0
_break
rts
_case4185
move.l #4,d0
jmp _break
_case4507
move.l #3,d0
jmp _break
_case4883
move.l #2,d0
jmp _break
_case5327
move.l #1,d0
jmp _break
But I want to write this in C... Suffice to say the actual list is much larger and CPU time is at a premium, is there any way I can write it without using Goto?