mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
iflag: Do the equality test in iflag_cmp() first
The equality test indicates how long we spin, so do that first. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
parent
80d18b5555
commit
afcb66f412
8
iflag.h
8
iflag.h
@ -46,10 +46,10 @@ static inline int iflag_cmp(const iflag_t *a, const iflag_t *b)
|
||||
int i;
|
||||
|
||||
for (i = sizeof(a->field) / sizeof(a->field[0]) - 1; i >= 0; i--) {
|
||||
if (a->field[i] < b->field[i])
|
||||
return -1;
|
||||
else if (a->field[i] > b->field[i])
|
||||
return 1;
|
||||
if (a->field[i] == b->field[i])
|
||||
continue;
|
||||
|
||||
return (a->field[i] > b->field[i]) ? 1 : -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user