Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify gnc_commodity equality and compare functions.
gnc_commodity_compare is used for sorting and so needs to have a less-than return value. The only place it's used presents nothing to the UI; a GncGUID ordering is fast and stable. GnuCash allows only one commodity per book for any namespace/mnemonic pair, so the exhaustive string comparisons are superflous. While the current engine design allows only one instance of any object, meaning that a pointer comparison is sufficient to determine equality, that may not be true in the future, but the GncGUID is guaranteed to sufficiently identify a single commodity. Note that gnc_commodity_equiv is used to enforce that single-commodity rule and so cannot use GncGUID comparison.
- Loading branch information
Showing
1 changed file
with
12 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters