1. Bryan O'Sullivan
  2. critbit

Commits

Comments (0)

Files changed (1)

File Data/CritBit/Tree.hs Modified

View file
  • Ignore whitespace
  • Hide word diff
 -- > elems (fromList [("b",5), ("a",3)]) == [3,5]
 -- > elems empty == []
 elems :: CritBit k v -> [v]
-elems m = foldrWithKey f [] m
-  where f _ v vs = v : vs
+elems m = foldr (:) [] m
+{-# INLINE elems #-}
 
 -- | /O(n)/. An alias for 'toAscList'. Return all key/value pairs in the map in
 -- ascending order.