yesod-core: refactor the loop detector to not use Just wrapping
This commit is contained in:
parent
96a940b60c
commit
59ef730317
@ -29,8 +29,8 @@ breadcrumbs = do
|
|||||||
go back Nothing = return back
|
go back Nothing = return back
|
||||||
go back (Just this) = do
|
go back (Just this) = do
|
||||||
(title, next) <- breadcrumb this
|
(title, next) <- breadcrumb this
|
||||||
if next `elem` (map (Just . fst) back)
|
if this `elem` map fst back
|
||||||
then
|
then
|
||||||
error $ "infinite recursion in breadcrumbs at" <> show title
|
error $ "yesod-core: infinite recursion in breadcrumbs at " <> show title
|
||||||
else
|
else
|
||||||
go ((this, title) : back) next
|
go ((this, title) : back) next
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user