From d79d227418d015aaa9a09af3a40d9ac828c438f0 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 31 Dec 2015 13:48:34 +0000 Subject: [PATCH] return asap --- .../other-builds/moses2/Search/CubePruning/Stack.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp b/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp index 6a6a3823c..8f4757c1c 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp +++ b/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp @@ -26,14 +26,12 @@ MiniStack::MiniStack(const Manager &mgr) StackAdd MiniStack::Add(const Hypothesis *hypo) { - StackAdd ret; std::pair addRet = m_coll.insert(hypo); // CHECK RECOMBINATION if (addRet.second) { // equiv hypo doesn't exists - ret.added = true; - ret.toBeDeleted = NULL; + return StackAdd(true, NULL); } else { const Hypothesis *hypoExisting = *addRet.first; @@ -43,17 +41,15 @@ StackAdd MiniStack::Add(const Hypothesis *hypo) const Hypothesis *&hypoExisting2 = const_cast(hypoExisting1); hypoExisting2 = hypo; - ret.added = true; - ret.toBeDeleted = const_cast(hypoExisting); + return StackAdd(true, const_cast(hypoExisting)); } else { // already storing the best hypo. discard incoming hypo - ret.added = false; - ret.toBeDeleted = const_cast(hypo); + return StackAdd(false, const_cast(hypo)); } } - return ret; + assert(false); } CubeEdge::Hypotheses &MiniStack::GetSortedAndPruneHypos(const Manager &mgr) const