diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2013-11-27 13:41:50 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-11-27 13:41:50 -0800 |
commit | afcb66f41281104c8dc70f628eeaedda67b13b97 (patch) | |
tree | 9e939bd67f8d79253fc78ae241633d0f7b6294db | |
parent | 80d18b55551e43f0c3e390550ecd396b90265fd3 (diff) | |
download | nasm-afcb66f41281104c8dc70f628eeaedda67b13b97.tar.gz nasm-afcb66f41281104c8dc70f628eeaedda67b13b97.tar.bz2 nasm-afcb66f41281104c8dc70f628eeaedda67b13b97.zip |
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>
-rw-r--r-- | iflag.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |