From aa0dac5fc79d70a977c1025502503b04db700ac3 Mon Sep 17 00:00:00 2001 From: Verena Reimund <reimund@ill.eu> Date: Tue, 5 Jun 2018 10:36:49 +0200 Subject: [PATCH] Remove unneeded passing by reference for doubles Refs #22197 --- .../inc/MantidAlgorithms/Stitch1D.h | 14 ++++++------ Framework/Algorithms/src/Stitch1D.cpp | 22 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h b/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h index dbe6d797f93..c6b6ea3a95a 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h @@ -61,11 +61,11 @@ private: /// Overwrites Algorithm method. void exec() override; /// Get the start overlap - double getStartOverlap(const double &intesectionMin, - const double &intesectionMax) const; + double getStartOverlap(const double intesectionMin, + const double intesectionMax) const; /// Get the end overlap - double getEndOverlap(const double &intesectionMin, - const double &intesectionMax) const; + double getEndOverlap(const double intesectionMin, + const double intesectionMax) const; /// Get the rebin parameters std::vector<double> @@ -78,9 +78,9 @@ private: const std::vector<double> ¶ms); /// Perform integration Mantid::API::MatrixWorkspace_sptr - integration(Mantid::API::MatrixWorkspace_sptr &input, const double &start, - const double &stop); - Mantid::API::MatrixWorkspace_sptr singleValueWS(const double &val); + integration(Mantid::API::MatrixWorkspace_sptr &input, const double start, + const double stop); + Mantid::API::MatrixWorkspace_sptr singleValueWS(const double val); /// Calculate the weighted mean Mantid::API::MatrixWorkspace_sptr weightedMean(Mantid::API::MatrixWorkspace_sptr &inOne, diff --git a/Framework/Algorithms/src/Stitch1D.cpp b/Framework/Algorithms/src/Stitch1D.cpp index 0c929cb94f1..a7123eb93e4 100644 --- a/Framework/Algorithms/src/Stitch1D.cpp +++ b/Framework/Algorithms/src/Stitch1D.cpp @@ -237,8 +237,8 @@ std::map<std::string, std::string> Stitch1D::validateInputs(void) { to inhabit @return a double contianing the start of the overlapping region */ -double Stitch1D::getStartOverlap(const double &intesectionMin, - const double &intesectionMax) const { +double Stitch1D::getStartOverlap(const double intesectionMin, + const double intesectionMax) const { Property *startOverlapProp = this->getProperty("StartOverlap"); double startOverlapVal = this->getProperty("StartOverlap"); startOverlapVal -= this->range_tolerance; @@ -268,8 +268,8 @@ double Stitch1D::getStartOverlap(const double &intesectionMin, to inhabit @return a double contianing the end of the overlapping region */ -double Stitch1D::getEndOverlap(const double &intesectionMin, - const double &intesectionMax) const { +double Stitch1D::getEndOverlap(const double intesectionMin, + const double intesectionMax) const { Property *endOverlapProp = this->getProperty("EndOverlap"); double endOverlapVal = this->getProperty("EndOverlap"); endOverlapVal += this->range_tolerance; @@ -380,7 +380,7 @@ MatrixWorkspace_sptr Stitch1D::rebin(MatrixWorkspace_sptr &input, auto &sourceE = outWS->mutableE(i); for (size_t j = 0; j < sourceY.size(); ++j) { - const double &value = sourceY[j]; + const double value = sourceY[j]; if (std::isnan(value)) { nanYIndexes.push_back(j); sourceY[j] = 0; @@ -389,7 +389,7 @@ MatrixWorkspace_sptr Stitch1D::rebin(MatrixWorkspace_sptr &input, sourceY[j] = 0; } - const double &eValue = sourceE[j]; + const double eValue = sourceE[j]; if (std::isnan(eValue)) { nanEIndexes.push_back(j); sourceE[j] = 0; @@ -413,8 +413,8 @@ MatrixWorkspace_sptr Stitch1D::rebin(MatrixWorkspace_sptr &input, @return A shared pointer to the resulting MatrixWorkspace */ MatrixWorkspace_sptr Stitch1D::integration(MatrixWorkspace_sptr &input, - const double &start, - const double &stop) { + const double start, + const double stop) { auto integration = this->createChildAlgorithm("Integration"); integration->initialize(); integration->setProperty("InputWorkspace", input); @@ -468,7 +468,7 @@ MatrixWorkspace_sptr Stitch1D::conjoinXAxis(MatrixWorkspace_sptr &inOne, @param val :: The double to convert to a single value workspace @return A shared pointer to the resulting MatrixWorkspace */ -MatrixWorkspace_sptr Stitch1D::singleValueWS(const double &val) { +MatrixWorkspace_sptr Stitch1D::singleValueWS(const double val) { auto singleValueWS = this->createChildAlgorithm("CreateSingleValuedWorkspace"); singleValueWS->initialize(); @@ -587,8 +587,8 @@ void Stitch1D::exec() { MatrixWorkspace_sptr rhs = rhsWS->clone(); if (lhsWS->isHistogramData()) { MantidVec params = getRebinParams(lhsWS, rhsWS, scaleRHS); - const double &xMin = params.front(); - const double &xMax = params.back(); + const double xMin = params.front(); + const double xMax = params.back(); if (std::abs(xMin - startOverlap) < 1E-6) startOverlap = xMin; -- GitLab