Skip to content

Commit

Permalink
returning Nil on empty IntMap as done in corresponding functions for Map
Browse files Browse the repository at this point in the history
  • Loading branch information
kushagarr committed Nov 8, 2024
1 parent 7e7ce15 commit dbf6bcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions containers/src/Data/IntMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,7 @@ updateMinWithKey f t =
go f' (Tip k y) = case f' k y of
Just y' -> Tip k y'
Nothing -> Nil
go _ Nil = error "updateMinWithKey Nil"
go _ Nil = Nil

-- | \(O(\min(n,W))\). Update the value at the maximal key.
--
Expand All @@ -2202,7 +2202,7 @@ updateMaxWithKey f t =
go f' (Tip k y) = case f' k y of
Just y' -> Tip k y'
Nothing -> Nil
go _ Nil = error "updateMaxWithKey Nil"
go _ Nil = Nil


data View a = View {-# UNPACK #-} !Key a !(IntMap a)
Expand Down

0 comments on commit dbf6bcc

Please sign in to comment.