Skip to content

Commit dde1046

Browse files
[transaction.cpp] comparing identical txns returns 0
bypassing many comparisons
1 parent 655bddd commit dde1046

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libgnucash/engine/Transaction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,9 +1829,9 @@ xaccTransOrder_num_action (const Transaction *ta, const char *actna,
18291829
const char *da, *db;
18301830
int retval;
18311831

1832-
if ( ta && !tb ) return -1;
1833-
if ( !ta && tb ) return +1;
1834-
if ( !ta && !tb ) return 0;
1832+
if (ta == tb) return 0;
1833+
if (!tb) return -1;
1834+
if (!ta) return +1;
18351835

18361836
if (ta->date_posted != tb->date_posted)
18371837
return (ta->date_posted > tb->date_posted) - (ta->date_posted < tb->date_posted);

0 commit comments

Comments
 (0)