[commit: containers] master: Improve query functions of Map and Set. (78c1e52)
Paolo Capriotti <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.cvs.libraries |
|---|---|
| Message-ID | <[email protected]> |
Repository : ssh://darcs.haskell.org//srv/darcs/packages/containers On branch : master http://hackage.haskell.org/trac/ghc/changeset/78c1e523a6dacb092da6fa2deef04d498fd588a3 >--------------------------------------------------------------- commit 78c1e523a6dacb092da6fa2deef04d498fd588a3 Author: Milan Straka <[email protected]> Date: Sat Apr 21 21:41:22 2012 +0200 Improve query functions of Map and Set. As documented in the Note: Local 'go' functions and capturing, it is safe to use captured key argument in query functions. Also, in order to decrease allocation, the query functions in Map are manually inlined, so 'member' does not have to call 'lookup' and heap-allocate 'Just a'. Tests of query functions are much improved too. Data/Map/Base.hs | 76 ++++++++++++++++++++++++++++++---------------- Data/Map/Strict.hs | 11 +++++-- Data/Set.hs | 24 ++++++++++---- tests/map-properties.hs | 38 ++++++++++++++++------- tests/set-properties.hs | 14 ++++++++- 5 files changed, 113 insertions(+), 50 deletions(-) Diff suppressed because of size. To see it, use: git show 78c1e523a6dacb092da6fa2deef04d498fd588a3