Cleanup
This commit is contained in:
@@ -162,18 +162,12 @@ invIndentIM =
|
||||
|
||||
-- returns an intmap with trees for all root items
|
||||
invTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ComposeLinkType Item)
|
||||
invTrees = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (bimap _iatType (\(x, y, _) -> (x, y))) . invLDT
|
||||
where
|
||||
getindex :: Item -> Int
|
||||
getindex i =
|
||||
fromMaybe (error "in invTrees try to get non-inventory item tree") $
|
||||
i ^? itLocation . ilInvID
|
||||
invTrees = fmap (first _iatType) . invTrees'
|
||||
|
||||
-- returns an intmap with trees for all root items
|
||||
invTrees' :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink Item)
|
||||
invTrees' = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (bimap id (\(x, y, _) -> (x, y))) . invLDT
|
||||
invTrees' = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (fmap (\(x, y, _) -> (x, y))) . invLDT
|
||||
where
|
||||
getindex :: Item -> Int
|
||||
getindex i =
|
||||
fromMaybe (error "in invTrees try to get non-inventory item tree") $
|
||||
i ^? itLocation . ilInvID
|
||||
|
||||
Reference in New Issue
Block a user