diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-08 17:38:41 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-08 17:38:41 +0400 |
commit | 88f888f5344b51161ab66afc53033eb8c665d3fd (patch) | |
tree | 94c8e7e936f3daf7d7a1bb54745103a3da831396 /moses/TargetPhraseCollection.cpp | |
parent | 9062194f46b18643c0636b15142da74e0d3dce83 (diff) |
const TargetPhrase in TargetPhraseCollection
Diffstat (limited to 'moses/TargetPhraseCollection.cpp')
-rw-r--r-- | moses/TargetPhraseCollection.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/moses/TargetPhraseCollection.cpp b/moses/TargetPhraseCollection.cpp index cb591e935..4d96cd8f8 100644 --- a/moses/TargetPhraseCollection.cpp +++ b/moses/TargetPhraseCollection.cpp @@ -36,7 +36,7 @@ struct CompareTargetPhrase { void TargetPhraseCollection::NthElement(size_t tableLimit) { - vector<TargetPhrase*>::iterator nth; + CollType::iterator nth; nth = (tableLimit && tableLimit <= m_collection.size() ? m_collection.begin() + tableLimit : m_collection.end()); @@ -49,7 +49,7 @@ void TargetPhraseCollection::Prune(bool adhereTableLimit, size_t tableLimit) if (adhereTableLimit && m_collection.size() > tableLimit) { for (size_t ind = tableLimit; ind < m_collection.size(); ++ind) { - TargetPhrase *targetPhrase = m_collection[ind]; + const TargetPhrase *targetPhrase = m_collection[ind]; delete targetPhrase; } m_collection.erase(m_collection.begin() + tableLimit, m_collection.end()); @@ -58,7 +58,7 @@ void TargetPhraseCollection::Prune(bool adhereTableLimit, size_t tableLimit) void TargetPhraseCollection::Sort(bool adhereTableLimit, size_t tableLimit) { - std::vector<TargetPhrase*>::iterator iterMiddle; + CollType::iterator iterMiddle; iterMiddle = (tableLimit == 0 || m_collection.size() < tableLimit) ? m_collection.end() : m_collection.begin()+tableLimit; @@ -68,7 +68,7 @@ void TargetPhraseCollection::Sort(bool adhereTableLimit, size_t tableLimit) if (adhereTableLimit && tableLimit && m_collection.size() > tableLimit) { for (size_t i = tableLimit; i < m_collection.size(); ++i) { - TargetPhrase *targetPhrase = m_collection[i]; + const TargetPhrase *targetPhrase = m_collection[i]; delete targetPhrase; } m_collection.erase(m_collection.begin()+tableLimit, m_collection.end()); |