Skip to content

Commit 1a5ba71

Browse files
committed
io-sim-por: refactor traceFinalRacesFound
1 parent 7293991 commit 1a5ba71

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

io-sim/src/Control/Monad/IOSimPOR/Internal.hs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,10 +1494,6 @@ normalizeRaces Races{ activeRaces, completeRaces } =
14941494
-- are assuming here that all work is completed before a timer
14951495
-- triggers.
14961496

1497-
quiescentRacesInSimState :: SimState s a -> SimState s a
1498-
quiescentRacesInSimState simstate@SimState{ races } =
1499-
simstate{ races = quiescentRaces races }
1500-
15011497
quiescentRaces :: Races -> Races
15021498
quiescentRaces Races{ activeRaces, completeRaces } =
15031499
Races{ activeRaces = [],
@@ -1590,12 +1586,15 @@ stepInfoToScheduleMods
15901586
| step' <- races ]
15911587

15921588
traceFinalRacesFound :: SimState s a -> SimTrace a -> SimTrace a
1593-
traceFinalRacesFound simstate@SimState{ control0 = control } =
1594-
TraceRacesFound [extendScheduleControl control m | m <- scheduleMods]
1595-
where SimState{ races } =
1596-
quiescentRacesInSimState simstate
1597-
scheduleMods =
1598-
concatMap stepInfoToScheduleMods $ completeRaces races
1589+
traceFinalRacesFound SimState{ control0 = control, races } =
1590+
TraceRacesFound [extendScheduleControl control m | m <- scheduleMods]
1591+
where
1592+
scheduleMods :: [ScheduleMod]
1593+
scheduleMods =
1594+
concatMap stepInfoToScheduleMods
1595+
. completeRaces
1596+
. quiescentRaces
1597+
$ races
15991598

16001599
-- Extend an existing schedule control with a newly discovered schedule mod
16011600
extendScheduleControl' :: ScheduleControl -> ScheduleMod -> ScheduleControl

0 commit comments

Comments
 (0)