Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-10-19 21:52:15 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-19 21:52:15 +0300
commitbb1304f7250d287e153e2fb3183310ea558c9065 (patch)
treee9c6636b9d2f8f0b505fcf743270252ade98b3ad /moses/HypothesisStackCubePruning.cpp
parent8ee350af2ffd195025507183da101b8b184cca12 (diff)
re-use key for bitmap container
Diffstat (limited to 'moses/HypothesisStackCubePruning.cpp')
-rw-r--r--moses/HypothesisStackCubePruning.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/moses/HypothesisStackCubePruning.cpp b/moses/HypothesisStackCubePruning.cpp
index 188b4f591..ce80fae41 100644
--- a/moses/HypothesisStackCubePruning.cpp
+++ b/moses/HypothesisStackCubePruning.cpp
@@ -299,8 +299,14 @@ BitmapContainer *HypothesisStackCubePruning::AddBitmapContainer(const WordsBitma
BitmapContainer *bmContainer;
if (iter == m_bitmapAccessor.end()) {
- bmContainer = new BitmapContainer(bitmap, stack, m_deterministic);
- m_bitmapAccessor[bitmap] = bmContainer;
+ _BMType::value_type element(bitmap, NULL);
+ pair<_BMType::iterator,bool> retPair = m_bitmapAccessor.insert(element);
+
+ _BMType::iterator iterRetPair = retPair.first;
+ const WordsBitmap &storedBitmap = iterRetPair->first;
+
+ bmContainer = new BitmapContainer(storedBitmap, stack, m_deterministic);
+ retPair.second = bmContainer;
} else {
bmContainer = iter->second;
}