mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-24 04:12:47 +03:00
Add missing chck for empty range while flushing
This commit is contained in:
parent
769c19d10c
commit
4140756fdf
@ -258,8 +258,10 @@ void LexicalReorderingTableCreator::FlushEncodedQueue(bool force)
|
||||
if(force) {
|
||||
m_lastFlushedLine = -1;
|
||||
|
||||
m_hash.AddRange(m_lastRange);
|
||||
m_lastRange.clear();
|
||||
if(!m_lastRange.empty()) {
|
||||
m_hash.AddRange(m_lastRange);
|
||||
m_lastRange.clear();
|
||||
}
|
||||
|
||||
#ifdef WITH_THREADS
|
||||
m_hash.WaitAll();
|
||||
@ -377,7 +379,6 @@ void EncodingTaskReordering::operator()()
|
||||
encodedLine, i);
|
||||
result.push_back(packedItem);
|
||||
}
|
||||
lines.clear();
|
||||
|
||||
{
|
||||
#ifdef WITH_THREADS
|
||||
@ -388,6 +389,7 @@ void EncodingTaskReordering::operator()()
|
||||
m_creator.FlushEncodedQueue();
|
||||
}
|
||||
|
||||
lines.clear();
|
||||
result.clear();
|
||||
lines.reserve(max_lines);
|
||||
result.reserve(max_lines);
|
||||
|
@ -878,8 +878,10 @@ void PhraseTableCreator::FlushRankedQueue(bool force)
|
||||
}
|
||||
|
||||
if(force) {
|
||||
m_rnkHash.AddRange(m_lastSourceRange);
|
||||
m_lastSourceRange.clear();
|
||||
if(!m_lastSourceRange.empty()) {
|
||||
m_rnkHash.AddRange(m_lastSourceRange);
|
||||
m_lastSourceRange.clear();
|
||||
}
|
||||
|
||||
#ifdef WITH_THREADS
|
||||
m_rnkHash.WaitAll();
|
||||
@ -963,8 +965,10 @@ void PhraseTableCreator::FlushEncodedQueue(bool force)
|
||||
m_lastCollection.clear();
|
||||
}
|
||||
|
||||
m_srcHash.AddRange(m_lastSourceRange);
|
||||
m_lastSourceRange.clear();
|
||||
if(!m_lastSourceRange.empty()) {
|
||||
m_srcHash.AddRange(m_lastSourceRange);
|
||||
m_lastSourceRange.clear();
|
||||
}
|
||||
|
||||
#ifdef WITH_THREADS
|
||||
m_srcHash.WaitAll();
|
||||
|
Loading…
Reference in New Issue
Block a user