From 94aaa7f098f58cee0a9635b14ae4e097a992aa15 Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Sun, 31 Aug 2014 15:16:53 +0200
Subject: [PATCH] Passing by reference and not by value

(asked by Gareth)
---
 src/reference/PointWiseMapping.cpp | 2 +-
 src/reference/PointWiseMapping.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/reference/PointWiseMapping.cpp b/src/reference/PointWiseMapping.cpp
index a7714422f..a24a2e7ad 100644
--- a/src/reference/PointWiseMapping.cpp
+++ b/src/reference/PointWiseMapping.cpp
@@ -90,7 +90,7 @@ unsigned PointWiseMapping::getPropertyIndex( const std::string& name ) const {
   return 0;
 }
 
-void PointWiseMapping::print( const std::string& method, double time, OFile& afile, const std::string& fmt ){
+void PointWiseMapping::print( const std::string& method, const double & time, OFile& afile, const std::string& fmt ){
   std::string descr2, descr="DESCRIPTION: results from %s analysis performed at time " + fmt +"\n";
   afile.printf(descr.c_str(), method.c_str(), time );
   if(fmt.find("-")!=std::string::npos){
diff --git a/src/reference/PointWiseMapping.h b/src/reference/PointWiseMapping.h
index b322e4105..446401355 100644
--- a/src/reference/PointWiseMapping.h
+++ b/src/reference/PointWiseMapping.h
@@ -75,7 +75,7 @@ public:
 /// Get a pointer to the matrix of pairwise distances
   Matrix<double>& modifyDmat();
 /// Print out the low dimensional mapping
-  void print( const std::string& method, double time, OFile& afile, const std::string& fmt );
+  void print( const std::string& method, const double & time, OFile& afile, const std::string& fmt );
 /// Get the low dimensional embedding coordinate
   double getProjectionCoordinate( const unsigned& iframe, const unsigned& jcoord ) const ;
 /// Set the value of the projection coordinate
-- 
GitLab