Skip to content

Commit

Permalink
Make IntSet splitMember strict in the key (#983)
Browse files Browse the repository at this point in the history
Currently, the key is ignored for an empty set.
  • Loading branch information
meooow25 authored Jan 14, 2024
1 parent 68e24da commit a4e8d16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions containers/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
### Breaking changes

* `Data.IntMap.Lazy.split`, `Data.IntMap.Strict.split`,
`Data.IntMap.Lazy.splitLookup` and `Data.IntMap.Strict.splitLookup` are now
strict in the key. Previously, the key was ignored for an empty map.
(Soumik Sarkar)
`Data.IntMap.Lazy.splitLookup`, `Data.IntMap.Strict.splitLookup` and
`Data.IntSet.splitMember` are now strict in the key. Previously, the key was
ignored for an empty map or set. (Soumik Sarkar)

## 0.7

Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/IntSet/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ splitMember x t =
in (lt, fnd, gt')
_ -> go x t
where
go x' t'@(Bin p m l r)
go !x' t'@(Bin p m l r)
| nomatch x' p m = if x' < p then (Nil, False, t') else (t', False, Nil)
| zero x' m =
case go x' l of
Expand Down

0 comments on commit a4e8d16

Please sign in to comment.