Use fromDistinctAscList rather than fromAscList
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
All good (597 modules, at 10:13:32)
|
All good (597 modules, at 10:20:30)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ updateCombineSections w cfig sss =
|
|||||||
where
|
where
|
||||||
mselpos = sss ^. sssExtra . sssSelPos
|
mselpos = sss ^. sssExtra . sssSelPos
|
||||||
availablelines = getAvailableListLines secondColumnParams cfig
|
availablelines = getAvailableListLines secondColumnParams cfig
|
||||||
allcombs = IM.fromAscList $ zip [0 ..] $ combineList w
|
allcombs = IM.fromDistinctAscList $ zip [0 ..] $ combineList w
|
||||||
filtcombs = fromMaybe allcombs $ do
|
filtcombs = fromMaybe allcombs $ do
|
||||||
str <- mstr
|
str <- mstr
|
||||||
invitms <- w ^? hud . hudElement . diSections . sssSections . ix 0 . ssItems
|
invitms <- w ^? hud . hudElement . diSections . sssSections . ix 0 . ssItems
|
||||||
@@ -239,7 +239,7 @@ enterCombineInv :: Configuration -> World -> World
|
|||||||
enterCombineInv cfig w =
|
enterCombineInv cfig w =
|
||||||
w & hud . hudElement . subInventory .~ CombineInventory sss
|
w & hud . hudElement . subInventory .~ CombineInventory sss
|
||||||
where
|
where
|
||||||
cm' = IM.fromAscList $ zip [0 ..] $ combineList w
|
cm' = IM.fromDistinctAscList . zip [0 ..] $ combineList w
|
||||||
cm
|
cm
|
||||||
| null cm' = IM.singleton 0 $ SelectionInfo ["No possible combinations"] 1 False white 0
|
| null cm' = IM.singleton 0 $ SelectionInfo ["No possible combinations"] 1 False white 0
|
||||||
| otherwise = cm'
|
| otherwise = cm'
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ invAdj im = do
|
|||||||
|
|
||||||
invIndentIM :: IM.IntMap Item -> IM.IntMap (Item, Int, LabelDoubleTreeNodeType ComposeLinkType)
|
invIndentIM :: IM.IntMap Item -> IM.IntMap (Item, Int, LabelDoubleTreeNodeType ComposeLinkType)
|
||||||
invIndentIM =
|
invIndentIM =
|
||||||
IM.fromAscList . zip [0 ..] . reverse . map (over _1 (^. _1))
|
IM.fromDistinctAscList . zip [0 ..] . reverse . map (over _1 (^. _1))
|
||||||
. concatMap ldtToIndentList
|
. concatMap ldtToIndentList
|
||||||
. map (bimap _iatType (\(x, y, _) -> (x, y)))
|
. map (bimap _iatType (\(x, y, _) -> (x, y)))
|
||||||
. invLDT
|
. invLDT
|
||||||
@@ -215,7 +215,7 @@ allInvLocs inv = foldMap (f . LocLDT TopLDT) (IM.elems (invRootTrees inv)) mempt
|
|||||||
|
|
||||||
-- returns an intmap with trees for root items, indexed by inventory position
|
-- returns an intmap with trees for root items, indexed by inventory position
|
||||||
invRootTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink ComposedItem)
|
invRootTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink ComposedItem)
|
||||||
invRootTrees = IM.fromAscList . reverse . map (getid . fmap (\(x, y, _) -> CItem x y)) . invLDT
|
invRootTrees = IM.fromDistinctAscList . reverse . map (getid . fmap (\(x, y, _) -> CItem x y)) . invLDT
|
||||||
where
|
where
|
||||||
getid :: LabelDoubleTree ItemLink ComposedItem -> (Int,LabelDoubleTree ItemLink ComposedItem)
|
getid :: LabelDoubleTree ItemLink ComposedItem -> (Int,LabelDoubleTree ItemLink ComposedItem)
|
||||||
getid t = (t ^?! ldtValue . cItem . itLocation . ilInvID, t)
|
getid t = (t ^?! ldtValue . cItem . itLocation . ilInvID, t)
|
||||||
|
|||||||
+1
-1
@@ -146,7 +146,7 @@ setupWorldBounds w =
|
|||||||
wallsFromRooms :: [Room] -> IM.IntMap Wall
|
wallsFromRooms :: [Room] -> IM.IntMap Wall
|
||||||
wallsFromRooms =
|
wallsFromRooms =
|
||||||
-- divideWalls .
|
-- divideWalls .
|
||||||
IM.fromAscList
|
IM.fromDistinctAscList
|
||||||
. zipWith f [0 ..]
|
. zipWith f [0 ..]
|
||||||
. removeInverseWalls
|
. removeInverseWalls
|
||||||
. foldl' (flip cutWalls) []
|
. foldl' (flip cutWalls) []
|
||||||
|
|||||||
Reference in New Issue
Block a user