pass by reference

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1717 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
bhaddow 2008-05-15 20:44:24 +00:00
parent 1a6dcf5e36
commit 165f7d049f
3 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ public:
inline void setIndex(size_t value){ idx=value; }
inline ScoreStats get(int i){ return array_.at(i); }
void add(ScoreStats e){ array_.push_back(e); }
void add(const ScoreStats& e){ array_.push_back(e); }
inline std::string name(){ return score_type; };
inline std::string name(std::string &sctype){ return score_type = sctype; };

View File

@ -116,7 +116,7 @@ void ScoreData::loadnbest(const std::string &file)
void ScoreData::add(ScoreStats e, int sent_idx){
void ScoreData::add(const ScoreStats& e, int sent_idx){
if (exists(sent_idx)){
array_.at(sent_idx).add(e);
}

View File

@ -43,8 +43,8 @@ public:
inline std::string name(){ return score_type; };
void add(ScoreArray e){ array_.push_back(e); }
void add(ScoreStats e, int sent_idx);
void add(const ScoreArray& e){ array_.push_back(e); }
void add(const ScoreStats& e, int sent_idx);
inline size_t size(){ return array_.size(); }