From 2b7c35f960b49627c315a0bcfb43bc92566b17da Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 20 Jul 2015 19:01:11 +0200 Subject: [PATCH 1/1] code factorization --- src/surf/surf_interface.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index e6fdd84087..f49641e416 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -728,11 +728,6 @@ void Action::initialize(Model *model, double cost, bool failed, m_lastUpdate = 0; m_suspended = false; m_hat = NOTSET; -} - -Action::Action(Model *model, double cost, bool failed) -{ - initialize(model, cost, failed); p_category = NULL; p_stateHookup.prev = 0; p_stateHookup.next = 0; @@ -744,18 +739,14 @@ Action::Action(Model *model, double cost, bool failed) p_stateSet->push_back(*this); } +Action::Action(Model *model, double cost, bool failed) +{ + initialize(model, cost, failed); +} + Action::Action(Model *model, double cost, bool failed, lmm_variable_t var) { initialize(model, cost, failed, var); - p_category = NULL; - p_stateHookup.prev = 0; - p_stateHookup.next = 0; - if (failed) - p_stateSet = getModel()->getFailedActionSet(); - else - p_stateSet = getModel()->getRunningActionSet(); - - p_stateSet->push_back(*this); } Action::~Action() { -- 2.20.1