From 9a757ffffe242d62c2f5802955b72f95963c4302 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Fri, 7 Apr 2017 18:09:35 +0100 Subject: [PATCH] Result ordering fix for qprofdiff --- contrib/qprofdiff/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/qprofdiff/main.cpp b/contrib/qprofdiff/main.cpp index 661e976ec..58d21b77d 100644 --- a/contrib/qprofdiff/main.cpp +++ b/contrib/qprofdiff/main.cpp @@ -108,12 +108,14 @@ typedef struct { typedef struct { string qid; diff_entry e; } diff_item; #define DIFF_LT(X) bool diff_item_lt_ ## X (diff_item const & l, diff_item const & r) { \ + int l_lt_r = l.e.d_ ## X < r.e.d_ ## X; \ + int l_eq_r = l.e.d_ ## X == r.e.d_ ## X; \ return \ - l.e.left_only ? (r.e.left_only ? l.qid < r.qid : false) : \ - l.e.right_only ? (r.e.right_only ? l.qid < r.qid : true) : \ + l.e.left_only ? (r.e.left_only ? ((l_eq_r) ? l.qid < r.qid : l_lt_r) : false) : \ + l.e.right_only ? (r.e.right_only ? ((l_eq_r) ? l.qid < r.qid : l_lt_r) : true) : \ r.e.right_only ? false : \ r.e.left_only ? true : \ - l.e.d_ ## X < r.e.d_ ## X ; \ + l_lt_r; \ } DIFF_LT(num_instances)