Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mert
diff options
context:
space:
mode:
authorbhaddow <bhaddow@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-16 00:44:24 +0400
committerbhaddow <bhaddow@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-16 00:44:24 +0400
commit165f7d049fe42d46315b7512268ea6e4891f2986 (patch)
tree24a3600bf29fbeee02facdc2476484a45e4e4478 /mert
parent1a6dcf5e36313919e5017cc7dcbf036765cb9872 (diff)
pass by reference
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1717 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert')
-rw-r--r--mert/ScoreArray.h2
-rw-r--r--mert/ScoreData.cpp2
-rw-r--r--mert/ScoreData.h4
3 files changed, 4 insertions, 4 deletions
diff --git a/mert/ScoreArray.h b/mert/ScoreArray.h
index 63e95d960..c9f65d05b 100644
--- a/mert/ScoreArray.h
+++ b/mert/ScoreArray.h
@@ -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; };
diff --git a/mert/ScoreData.cpp b/mert/ScoreData.cpp
index 0063bd8be..6b5e7975f 100644
--- a/mert/ScoreData.cpp
+++ b/mert/ScoreData.cpp
@@ -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);
}
diff --git a/mert/ScoreData.h b/mert/ScoreData.h
index 0943301d2..2718de065 100644
--- a/mert/ScoreData.h
+++ b/mert/ScoreData.h
@@ -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(); }