mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[commodity-utilities] simplify gnc:uniform-commodity?
old code was confusing; returns non-#f if either of following is true: - elts is null list - elts is 1-element list and report-commodity is a member of this 1-element list change to much more intelligible code
This commit is contained in:
parent
eab4eecac8
commit
c045e7c5ec
@ -1032,9 +1032,7 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(define (gnc:uniform-commodity? amt report-commodity)
|
||||
;; function to see if the commodity-collector amt
|
||||
;; contains any foreign commodities
|
||||
(let ((elts (amt 'format (lambda (comm amt) comm) #f)))
|
||||
(or (null? elts)
|
||||
(and (null? (cdr elts))
|
||||
(member report-commodity
|
||||
elts
|
||||
gnc-commodity-equiv)))))
|
||||
(let ((list-of-commodities (amt 'format (lambda (comm amt) comm) #f)))
|
||||
(or (null? list-of-commodities)
|
||||
(and (null? (cdr list-of-commodities))
|
||||
(gnc-commodity-equiv report-commodity (car list-of-commodities))))))
|
||||
|
Loading…
Reference in New Issue
Block a user