From dde10464d1bd0bafb6ba44af7a18680e0cf2b08b Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 2 Nov 2025 22:28:25 +0800 Subject: [PATCH] [transaction.cpp] comparing identical txns returns 0 bypassing many comparisons --- libgnucash/engine/Transaction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgnucash/engine/Transaction.cpp b/libgnucash/engine/Transaction.cpp index 51c7ee7ae8..32f6f3cb9c 100644 --- a/libgnucash/engine/Transaction.cpp +++ b/libgnucash/engine/Transaction.cpp @@ -1829,9 +1829,9 @@ xaccTransOrder_num_action (const Transaction *ta, const char *actna, const char *da, *db; int retval; - if ( ta && !tb ) return -1; - if ( !ta && tb ) return +1; - if ( !ta && !tb ) return 0; + if (ta == tb) return 0; + if (!tb) return -1; + if (!ta) return +1; if (ta->date_posted != tb->date_posted) return (ta->date_posted > tb->date_posted) - (ta->date_posted < tb->date_posted);