Skip to content

Commit

Permalink
Shortcut when trans opts cache is size 0. Avoids potential uninitiali…
Browse files Browse the repository at this point in the history
…sed read.

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3825 1f5c12ca-751b-0410-a591-d2e778427230
  • Loading branch information
bhaddow committed Jan 21, 2011
1 parent b0ae523 commit f5cc2c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions moses/src/StaticData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ void StaticData::ReduceTransOptCache() const

void StaticData::AddTransOptListToCache(const DecodeGraph &decodeGraph, const Phrase &sourcePhrase, const TranslationOptionList &transOptList) const
{
if (m_transOptCacheMaxSize == 0) return;
std::pair<size_t, Phrase> key(decodeGraph.GetPosition(), sourcePhrase);
TranslationOptionList* storedTransOptList = new TranslationOptionList(transOptList);
#ifdef WITH_THREADS
Expand Down

0 comments on commit f5cc2c4

Please sign in to comment.