mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
engine-utilities.scm: Add a couple of hashtable functions.
This commit is contained in:
parent
cca9cc7c22
commit
eb600c79a4
@ -80,6 +80,18 @@
|
||||
(+ acct-depth (- (gnc-account-get-tree-depth acct) 1))))
|
||||
accounts)))
|
||||
|
||||
(define (account-assoc acc alist)
|
||||
(find (lambda (pair) (account-same? acc (car pair))) alist))
|
||||
|
||||
(define (account-hash acc size)
|
||||
(remainder (string-hash (gncAccountGetGUID acc)) size))
|
||||
|
||||
(define (account-hashtable-ref table account)
|
||||
(hashx-ref account-hash account-assoc table account))
|
||||
|
||||
(define (account-hashtable-set! table account value)
|
||||
(hashx-set! account-hash account-assoc table account value))
|
||||
|
||||
;; Splits
|
||||
(export split-same?)
|
||||
(export split-in-list?)
|
||||
|
@ -79,6 +79,8 @@
|
||||
(export account-full-name<?)
|
||||
(export account-list-predicate)
|
||||
(export accounts-get-children-depth)
|
||||
(export account-hashtable-ref)
|
||||
(export account-hashtable-set!)
|
||||
|
||||
(export split-same?)
|
||||
(export split-in-list?)
|
||||
|
Loading…
Reference in New Issue
Block a user