diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-29 21:16:15 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-29 21:16:15 +0400 |
commit | 6249432407af8730c10bccc7894c0725fcaf5e47 (patch) | |
tree | 3ac1f094b9fdc199b04bc5ef209ce00e3596e37d /mert/ScoreDataIterator.cpp | |
parent | 59bd7deb4b6b9c4f7b3b7dbb055783528fbc31ca (diff) |
beautify
Diffstat (limited to 'mert/ScoreDataIterator.cpp')
-rw-r--r-- | mert/ScoreDataIterator.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/mert/ScoreDataIterator.cpp b/mert/ScoreDataIterator.cpp index 80568b810..71e05ab0b 100644 --- a/mert/ScoreDataIterator.cpp +++ b/mert/ScoreDataIterator.cpp @@ -29,18 +29,20 @@ using namespace util; namespace MosesTuning { - + ScoreDataIterator::ScoreDataIterator() {} -ScoreDataIterator::ScoreDataIterator(const string& filename) { +ScoreDataIterator::ScoreDataIterator(const string& filename) +{ m_in.reset(new FilePiece(filename.c_str())); readNext(); } ScoreDataIterator::~ScoreDataIterator() {} -void ScoreDataIterator::readNext() { +void ScoreDataIterator::readNext() +{ m_next.clear(); try { StringPiece marker = m_in->ReadDelimited(); @@ -71,12 +73,14 @@ void ScoreDataIterator::readNext() { } } -void ScoreDataIterator::increment() { +void ScoreDataIterator::increment() +{ readNext(); } -bool ScoreDataIterator::equal(const ScoreDataIterator& rhs) const { +bool ScoreDataIterator::equal(const ScoreDataIterator& rhs) const +{ if (!m_in && !rhs.m_in) { return true; } else if (!m_in) { @@ -84,13 +88,14 @@ bool ScoreDataIterator::equal(const ScoreDataIterator& rhs) const { } else if (!rhs.m_in) { return false; } else { - return m_in->FileName() == rhs.m_in->FileName() && - m_in->Offset() == rhs.m_in->Offset(); + return m_in->FileName() == rhs.m_in->FileName() && + m_in->Offset() == rhs.m_in->Offset(); } } -const vector<ScoreDataItem>& ScoreDataIterator::dereference() const { +const vector<ScoreDataItem>& ScoreDataIterator::dereference() const +{ return m_next; } |