[commit: containers] master: Improve query functions of Map and Set. (78c1e52)
Paolo Capriotti
p.capriotti at gmail.com
Thu Jul 19 21:12:19 CEST 2012
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 <fox at ucw.cz>
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
More information about the Cvs-libraries
mailing list