Skip to content

Commit

Permalink
fix(core): consider stage count when hydrating executions (#7194)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Jul 8, 2019
1 parent 45ca048 commit 6ff736e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ export class ExecutionService {
// stages *should* be in the same order, so getting the hydrated one by index should be fine.
// worth verifying, though, and, if not, find the stage by id (which makes this an O(n^2) operation instead of O(n))
const hydratedStage =
hydrated.stages[i].id === s.id ? hydrated.stages[i] : hydrated.stages.find(s2 => s.id === s2.id);
hydrated.stages.length === unhydrated.stages.length && hydrated.stages[i].id === s.id
? hydrated.stages[i]
: hydrated.stages.find(s2 => s.id === s2.id);
if (hydratedStage) {
s.context = hydratedStage.context;
s.outputs = hydratedStage.outputs;
Expand Down

0 comments on commit 6ff736e

Please sign in to comment.