From: nasm-bot f. H. P. A. <hp...@li...> - 2013-11-27 21:45:25
|
Commit-ID: afcb66f41281104c8dc70f628eeaedda67b13b97 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=afcb66f41281104c8dc70f628eeaedda67b13b97 Author: H. Peter Anvin <hp...@li...> AuthorDate: Wed, 27 Nov 2013 13:41:50 -0800 Committer: H. Peter Anvin <hp...@li...> CommitDate: Wed, 27 Nov 2013 13:41:50 -0800 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 <hp...@li...> --- iflag.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iflag.h b/iflag.h index b1144be..8754174 100644 --- a/iflag.h +++ b/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; |