Support a generic "original" payload in structure recognizer #862
Annotations
1 error and 2 warnings
Run HLint
HLint failed with status: 1. Warning (2)
|
Run HLint:
src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Tracking.hs#L72
Warning in entityModified in module Swarm.Game.Scenario.Topography.Structure.Recognition.Tracking: Redundant return ▫︎ Found: "do stateRevision <- case HM.lookup newEntity entLookup of\n Nothing -> return oldRecognitionState\n Just finder\n -> do tell . pure . FoundParticipatingEntity\n $ ParticipatingEntity newEntity (finder ^. inspectionOffsets)\n registerRowMatches entLoader cLoc finder oldRecognitionState\n return stateRevision" ▫︎ Perhaps: "do case HM.lookup newEntity entLookup of\n Nothing -> return oldRecognitionState\n Just finder\n -> do tell . pure . FoundParticipatingEntity\n $ ParticipatingEntity newEntity (finder ^. inspectionOffsets)\n registerRowMatches entLoader cLoc finder oldRecognitionState"
|
Run HLint:
src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Tracking.hs#L86
Warning in entityModified in module Swarm.Game.Scenario.Topography.Structure.Recognition.Tracking: Redundant return ▫︎ Found: "do stateRevision <- case\n M.lookup cLoc $ foundByLocation structureRegistry\n of\n Nothing -> return oldRecognitionState\n Just fs\n -> do tell $ pure $ StructureRemoved structureName\n return\n $ oldRecognitionState & foundStructures %~ removeStructure fs\n where\n structureName = getName $ originalDefinition $ structureWithGrid fs\n return stateRevision" ▫︎ Perhaps: "do case M.lookup cLoc $ foundByLocation structureRegistry of\n Nothing -> return oldRecognitionState\n Just fs\n -> do tell $ pure $ StructureRemoved structureName\n return\n $ oldRecognitionState & foundStructures %~ removeStructure fs\n where\n structureName = getName $ originalDefinition $ structureWithGrid fs"
|
Loading