Skip to content

Commit

Permalink
clean up code in Sectionable instance of SegTree
Browse files Browse the repository at this point in the history
The fix for section t a b when a > b in dcedd10 reimplemented
reverseDomain. Call reverseDomain instead.
  • Loading branch information
Mike Zuser committed Mar 20, 2019
1 parent 729bd7b commit d40c12e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Diagrams/Trail.hs
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ instance (Metric v, OrderedField n, Real n) => Sectionable (SegTree v n) where

section x p1 p2 | p1 <= p2 = let ((a, _), rescale) = splitAtParam' x p2
in snd $ splitAtParam a (rescale p1)
| otherwise = let (SegTree t) = section x p2 p1
in SegTree . FT.reverse $ FT.fmap' reverseSegment t
| otherwise = reverseDomain $ section x p2 p1

instance (Metric v, OrderedField n, Real n)
=> HasArcLength (SegTree v n) where
Expand Down

0 comments on commit d40c12e

Please sign in to comment.