[commodity-utilities] deprecate gnc-commodity-collector-contains-commodity?

this function is only used once. inline it.
This commit is contained in:
Christopher Lam 2019-01-09 08:42:20 +08:00
parent e3160af417
commit 058ef28849
2 changed files with 6 additions and 3 deletions

View File

@ -1021,6 +1021,8 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
(length (collector 'format (lambda (comm amt) comm) #f)))
(define (gnc-commodity-collector-contains-commodity? collector commodity)
(issue-deprecation-warning
"gnc-commodity-collector-contains-commodity? is deprecated. please inline.")
(member commodity
(collector 'format (lambda (comm amt) comm) #f)
gnc-commodity-equiv))
@ -1031,5 +1033,6 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
(let ((elts (gnc-commodity-collector-commodity-count amt)))
(or (zero? elts)
(and (= elts 1)
(gnc-commodity-collector-contains-commodity?
amt report-commodity)))))
(member report-commodity
(amt 'format (lambda (comm amt) comm) #f)
gnc-commodity-equiv)))))

View File

@ -66,7 +66,7 @@
(export gnc:case-exchange-time-fn)
(export gnc:sum-collector-commodity)
(export gnc:sum-collector-stocks)
(export gnc-commodity-collector-contains-commodity?)
(export gnc-commodity-collector-contains-commodity?) ;deprecated
;; options-utilities.scm