From 847286a455df7f32948626cda68d02b600421125 Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Tue, 24 Apr 2018 11:53:32 +0200 Subject: [PATCH] =?UTF-8?q?:gear:=20Elimination=20de=20code=20mort=20(hypo?= =?UTF-8?q?th=C3=A8ses=20de=20simulation)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/reducers.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source/reducers.js b/source/reducers.js index 39ae2f40e..c600a0be1 100644 --- a/source/reducers.js +++ b/source/reducers.js @@ -66,14 +66,9 @@ export let reduceSteps = (tracker, flatRules, answerSource) => ( name => state.activeTargetInput && state.activeTargetInput.includes(name) )(state.targetNames) - let sim = {}, - // Hard assumptions cannot be changed, they are used to specialise a simulator - // before the user sees the first question - hardAssumptions = pathOr({}, ['simulateur', 'hypothèses'], sim), - intermediateSituation = assume(answerSource, hardAssumptions), - // Most rules have default values - rulesDefaults = collectDefaults(flatRules), - situationWithDefaults = assume(intermediateSituation, rulesDefaults) + // Most rules have default values + let rulesDefaults = collectDefaults(flatRules), + situationWithDefaults = assume(answerSource, rulesDefaults) let analysis = analyseMany(state.parsedRules, targetNames)( situationWithDefaults(state) @@ -84,7 +79,7 @@ export let reduceSteps = (tracker, flatRules, answerSource) => ( } let nextStepsAnalysis = analyseMany(state.parsedRules, targetNames)( - intermediateSituation(state) + answerSource(state) ), missingVariablesByTarget = collectMissingVariablesByTarget( nextStepsAnalysis.targets