Commit 2357c748 authored by David Fairbrother's avatar David Fairbrother
Browse files

Clang-tidy pass by ref

Runs clang-tidy pass by ref across the codebase to fix-up various
warnings we are seeing in cppcheck
parent 08088625
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>
#include <sstream> #include <sstream>
#include <utility>
namespace Mantid { namespace Mantid {
namespace API { namespace API {
...@@ -87,7 +88,7 @@ boost::shared_ptr<IFunction> IFunction::clone() const { ...@@ -87,7 +88,7 @@ boost::shared_ptr<IFunction> IFunction::clone() const {
*/ */
void IFunction::setProgressReporter( void IFunction::setProgressReporter(
boost::shared_ptr<Kernel::ProgressBase> reporter) { boost::shared_ptr<Kernel::ProgressBase> reporter) {
m_progReporter = reporter; m_progReporter = std::move(reporter);
m_progReporter->setNotifyStep(0.01); m_progReporter->setNotifyStep(0.01);
} }
...@@ -1241,8 +1242,9 @@ void IFunction::setMatrixWorkspace( ...@@ -1241,8 +1242,9 @@ void IFunction::setMatrixWorkspace(
* @param wsIndex :: workspace index * @param wsIndex :: workspace index
* @return converted value * @return converted value
*/ */
double IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit, double
boost::shared_ptr<const MatrixWorkspace> ws, IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
const boost::shared_ptr<const MatrixWorkspace> &ws,
size_t wsIndex) const { size_t wsIndex) const {
// only required if formula or look-up-table different from ws unit // only required if formula or look-up-table different from ws unit
const auto &wsUnit = ws->getAxis(0)->unit(); const auto &wsUnit = ws->getAxis(0)->unit();
...@@ -1271,7 +1273,7 @@ double IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit, ...@@ -1271,7 +1273,7 @@ double IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
*/ */
void IFunction::convertValue(std::vector<double> &values, void IFunction::convertValue(std::vector<double> &values,
Kernel::Unit_sptr &outUnit, Kernel::Unit_sptr &outUnit,
boost::shared_ptr<const MatrixWorkspace> ws, const boost::shared_ptr<const MatrixWorkspace> &ws,
size_t wsIndex) const { size_t wsIndex) const {
// only required if formula or look-up-table different from ws unit // only required if formula or look-up-table different from ws unit
const auto &wsUnit = ws->getAxis(0)->unit(); const auto &wsUnit = ws->getAxis(0)->unit();
...@@ -1448,7 +1450,7 @@ void IFunction::storeReadOnlyAttribute( ...@@ -1448,7 +1450,7 @@ void IFunction::storeReadOnlyAttribute(
* @param covar :: A matrix to set. * @param covar :: A matrix to set.
*/ */
void IFunction::setCovarianceMatrix( void IFunction::setCovarianceMatrix(
boost::shared_ptr<Kernel::Matrix<double>> covar) { const boost::shared_ptr<Kernel::Matrix<double>> &covar) {
// the matrix shouldn't be empty // the matrix shouldn't be empty
if (!covar) { if (!covar) {
throw std::invalid_argument( throw std::invalid_argument(
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "MantidKernel/VMD.h" #include "MantidKernel/VMD.h"
#include <sstream> #include <sstream>
#include <utility>
using Mantid::Kernel::VMD; using Mantid::Kernel::VMD;
...@@ -53,7 +54,7 @@ std::string IMDWorkspace::getConvention() const { return m_convention; } ...@@ -53,7 +54,7 @@ std::string IMDWorkspace::getConvention() const { return m_convention; }
/** @return the convention /** @return the convention
*/ */
void IMDWorkspace::setConvention(std::string convention) { void IMDWorkspace::setConvention(std::string convention) {
m_convention = convention; m_convention = std::move(convention);
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// NScD Oak Ridge National Laboratory, European Spallation Source, // NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include <utility>
#include "MantidAPI/IndexProperty.h" #include "MantidAPI/IndexProperty.h"
#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/MatrixWorkspace.h"
#include "MantidIndexing/GlobalSpectrumIndex.h" #include "MantidIndexing/GlobalSpectrumIndex.h"
...@@ -16,9 +18,10 @@ namespace API { ...@@ -16,9 +18,10 @@ namespace API {
IndexProperty::IndexProperty(const std::string &name, IndexProperty::IndexProperty(const std::string &name,
const IWorkspaceProperty &workspaceProp, const IWorkspaceProperty &workspaceProp,
const IndexTypeProperty &indexTypeProp, const IndexTypeProperty &indexTypeProp,
Kernel::IValidator_sptr validator) const Kernel::IValidator_sptr &validator)
: ArrayProperty(name, "", validator), m_workspaceProp(workspaceProp), : ArrayProperty(name, "", std::move(validator)),
m_indexTypeProp(indexTypeProp), m_indices(0), m_indicesExtracted(false) {} m_workspaceProp(workspaceProp), m_indexTypeProp(indexTypeProp),
m_indices(0), m_indicesExtracted(false) {}
IndexProperty *IndexProperty::clone() const { return new IndexProperty(*this); } IndexProperty *IndexProperty::clone() const { return new IndexProperty(*this); }
......
...@@ -33,7 +33,7 @@ const FunctionDomain &JointDomain::getDomain(size_t i) const { ...@@ -33,7 +33,7 @@ const FunctionDomain &JointDomain::getDomain(size_t i) const {
* Add a new domain. * Add a new domain.
* @param domain :: A shared pointer to a domain. * @param domain :: A shared pointer to a domain.
*/ */
void JointDomain::addDomain(FunctionDomain_sptr domain) { void JointDomain::addDomain(const FunctionDomain_sptr &domain) {
m_domains.emplace_back(domain); m_domains.emplace_back(domain);
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <Poco/NObserver.h> #include <Poco/NObserver.h>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <utility>
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
using namespace Mantid::API; using namespace Mantid::API;
...@@ -244,7 +245,7 @@ size_t MDGeometry::getDimensionIndexById(const std::string &id) const { ...@@ -244,7 +245,7 @@ size_t MDGeometry::getDimensionIndexById(const std::string &id) const {
/** Add a dimension /** Add a dimension
* @param dim :: shared pointer to the dimension object */ * @param dim :: shared pointer to the dimension object */
void MDGeometry::addDimension( void MDGeometry::addDimension(
boost::shared_ptr<Mantid::Geometry::IMDDimension> dim) { const boost::shared_ptr<Mantid::Geometry::IMDDimension> &dim) {
m_dimensions.emplace_back(dim); m_dimensions.emplace_back(dim);
} }
...@@ -382,7 +383,7 @@ void MDGeometry::setOriginalWorkspace(boost::shared_ptr<Workspace> ws, ...@@ -382,7 +383,7 @@ void MDGeometry::setOriginalWorkspace(boost::shared_ptr<Workspace> ws,
size_t index) { size_t index) {
if (index >= m_originalWorkspaces.size()) if (index >= m_originalWorkspaces.size())
m_originalWorkspaces.resize(index + 1); m_originalWorkspaces.resize(index + 1);
m_originalWorkspaces[index] = ws; m_originalWorkspaces[index] = std::move(ws);
m_notificationHelper->watchForWorkspaceDeletions(); m_notificationHelper->watchForWorkspaceDeletions();
} }
......
...@@ -36,7 +36,7 @@ MultiPeriodGroupWorker::MultiPeriodGroupWorker( ...@@ -36,7 +36,7 @@ MultiPeriodGroupWorker::MultiPeriodGroupWorker(
* @param vecWorkspaceGroups: Vector of non-multi period workspace groups. * @param vecWorkspaceGroups: Vector of non-multi period workspace groups.
*/ */
void MultiPeriodGroupWorker::tryAddInputWorkspaceToInputGroups( void MultiPeriodGroupWorker::tryAddInputWorkspaceToInputGroups(
Workspace_sptr ws, const Workspace_sptr &ws,
MultiPeriodGroupWorker::VecWSGroupType &vecMultiPeriodWorkspaceGroups, MultiPeriodGroupWorker::VecWSGroupType &vecMultiPeriodWorkspaceGroups,
MultiPeriodGroupWorker::VecWSGroupType &vecWorkspaceGroups) const { MultiPeriodGroupWorker::VecWSGroupType &vecWorkspaceGroups) const {
WorkspaceGroup_sptr inputGroup = WorkspaceGroup_sptr inputGroup =
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <sstream> #include <sstream>
#include <utility>
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
using namespace Mantid::API; using namespace Mantid::API;
...@@ -62,7 +63,8 @@ MultipleExperimentInfos::getExperimentInfo(const uint16_t runIndex) const { ...@@ -62,7 +63,8 @@ MultipleExperimentInfos::getExperimentInfo(const uint16_t runIndex) const {
* @return the runIndex at which it was added * @return the runIndex at which it was added
* @throw std::runtime_error if you reach the limit of 65536 entries. * @throw std::runtime_error if you reach the limit of 65536 entries.
*/ */
uint16_t MultipleExperimentInfos::addExperimentInfo(ExperimentInfo_sptr ei) { uint16_t
MultipleExperimentInfos::addExperimentInfo(const ExperimentInfo_sptr &ei) {
m_expInfos.emplace_back(ei); m_expInfos.emplace_back(ei);
if (m_expInfos.size() >= if (m_expInfos.size() >=
static_cast<size_t>(std::numeric_limits<uint16_t>::max())) static_cast<size_t>(std::numeric_limits<uint16_t>::max()))
...@@ -82,7 +84,7 @@ void MultipleExperimentInfos::setExperimentInfo(const uint16_t runIndex, ...@@ -82,7 +84,7 @@ void MultipleExperimentInfos::setExperimentInfo(const uint16_t runIndex,
if (size_t(runIndex) >= m_expInfos.size()) if (size_t(runIndex) >= m_expInfos.size())
throw std::invalid_argument( throw std::invalid_argument(
"MDEventWorkspace::setExperimentInfo(): runIndex is out of range."); "MDEventWorkspace::setExperimentInfo(): runIndex is out of range.");
m_expInfos[runIndex] = ei; m_expInfos[runIndex] = std::move(ei);
} }
//----------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "MantidKernel/Property.h" #include "MantidKernel/Property.h"
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <utility>
namespace Mantid { namespace Mantid {
namespace API { namespace API {
...@@ -25,10 +26,10 @@ namespace { ...@@ -25,10 +26,10 @@ namespace {
Mantid::Kernel::Logger g_log("NotebookBuilder"); Mantid::Kernel::Logger g_log("NotebookBuilder");
} }
NotebookBuilder::NotebookBuilder(boost::shared_ptr<HistoryView> view, NotebookBuilder::NotebookBuilder(const boost::shared_ptr<HistoryView> &view,
std::string versionSpecificity) std::string versionSpecificity)
: m_historyItems(view->getAlgorithmsList()), m_output(), : m_historyItems(view->getAlgorithmsList()), m_output(),
m_versionSpecificity(versionSpecificity), m_versionSpecificity(std::move(versionSpecificity)),
m_nb_writer(new NotebookWriter()) {} m_nb_writer(new NotebookWriter()) {}
/** /**
...@@ -39,9 +40,9 @@ NotebookBuilder::NotebookBuilder(boost::shared_ptr<HistoryView> view, ...@@ -39,9 +40,9 @@ NotebookBuilder::NotebookBuilder(boost::shared_ptr<HistoryView> view,
* @param ws_comment :: workspace comment * @param ws_comment :: workspace comment
* @return a formatted ipython notebook string of the history * @return a formatted ipython notebook string of the history
*/ */
const std::string NotebookBuilder::build(std::string ws_name, const std::string NotebookBuilder::build(const std::string &ws_name,
std::string ws_title, const std::string &ws_title,
std::string ws_comment) { const std::string &ws_comment) {
// record workspace details in notebook // record workspace details in notebook
std::string workspace_details; std::string workspace_details;
workspace_details = "Workspace History: " + ws_name + "\n"; workspace_details = "Workspace History: " + ws_name + "\n";
...@@ -109,8 +110,8 @@ void NotebookBuilder::buildChildren( ...@@ -109,8 +110,8 @@ void NotebookBuilder::buildChildren(
* @param algHistory :: pointer to an algorithm history object * @param algHistory :: pointer to an algorithm history object
* @returns std::string to run this algorithm * @returns std::string to run this algorithm
*/ */
const std::string const std::string NotebookBuilder::buildAlgorithmString(
NotebookBuilder::buildAlgorithmString(AlgorithmHistory_const_sptr algHistory) { const AlgorithmHistory_const_sptr &algHistory) {
std::ostringstream properties; std::ostringstream properties;
const std::string name = algHistory->name(); const std::string name = algHistory->name();
std::string prop; std::string prop;
...@@ -159,8 +160,8 @@ NotebookBuilder::buildAlgorithmString(AlgorithmHistory_const_sptr algHistory) { ...@@ -159,8 +160,8 @@ NotebookBuilder::buildAlgorithmString(AlgorithmHistory_const_sptr algHistory) {
* @param propHistory :: reference to a property history object * @param propHistory :: reference to a property history object
* @returns std::string for this property * @returns std::string for this property
*/ */
const std::string const std::string NotebookBuilder::buildPropertyString(
NotebookBuilder::buildPropertyString(PropertyHistory_const_sptr propHistory) { const PropertyHistory_const_sptr &propHistory) {
using Mantid::Kernel::Direction; using Mantid::Kernel::Direction;
// Create a vector of all non workspace property type names // Create a vector of all non workspace property type names
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// NScD Oak Ridge National Laboratory, European Spallation Source, // NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include <utility>
#include "MantidAPI/NotebookWriter.h" #include "MantidAPI/NotebookWriter.h"
#include "MantidKernel/Logger.h" #include "MantidKernel/Logger.h"
#include "MantidKernel/MantidVersion.h" #include "MantidKernel/MantidVersion.h"
...@@ -34,7 +36,7 @@ void NotebookWriter::codeCell(Json::Value array_code) { ...@@ -34,7 +36,7 @@ void NotebookWriter::codeCell(Json::Value array_code) {
cell_data["cell_type"] = "code"; cell_data["cell_type"] = "code";
cell_data["collapsed"] = false; cell_data["collapsed"] = false;
cell_data["input"] = array_code; cell_data["input"] = std::move(array_code);
cell_data["language"] = "python"; cell_data["language"] = "python";
cell_data["metadata"] = empty; cell_data["metadata"] = empty;
cell_data["outputs"] = Json::Value(Json::arrayValue); cell_data["outputs"] = Json::Value(Json::arrayValue);
...@@ -47,7 +49,7 @@ void NotebookWriter::codeCell(Json::Value array_code) { ...@@ -47,7 +49,7 @@ void NotebookWriter::codeCell(Json::Value array_code) {
* *
* @param string_code :: string containing the python for the code cell * @param string_code :: string containing the python for the code cell
*/ */
std::string NotebookWriter::codeCell(std::string string_code) { std::string NotebookWriter::codeCell(const std::string &string_code) {
Json::Value cell_data; Json::Value cell_data;
const Json::Value empty = Json::Value(Json::ValueType::objectValue); const Json::Value empty = Json::Value(Json::ValueType::objectValue);
...@@ -77,7 +79,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) { ...@@ -77,7 +79,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) {
cell_data["cell_type"] = "markdown"; cell_data["cell_type"] = "markdown";
cell_data["metadata"] = empty; cell_data["metadata"] = empty;
cell_data["source"] = string_array; cell_data["source"] = std::move(string_array);
m_cell_buffer.append(cell_data); m_cell_buffer.append(cell_data);
} }
...@@ -87,7 +89,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) { ...@@ -87,7 +89,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) {
* *
* @param string_text :: string containing the python code for the code cell * @param string_text :: string containing the python code for the code cell
*/ */
std::string NotebookWriter::markdownCell(std::string string_text) { std::string NotebookWriter::markdownCell(const std::string &string_text) {
Json::Value cell_data; Json::Value cell_data;
const Json::Value empty = Json::Value(Json::ValueType::objectValue); const Json::Value empty = Json::Value(Json::ValueType::objectValue);
......
...@@ -65,8 +65,8 @@ IRemoteJobManager_sptr RemoteJobManagerFactoryImpl::create( ...@@ -65,8 +65,8 @@ IRemoteJobManager_sptr RemoteJobManagerFactoryImpl::create(
* the type (for example the type is not recognized). * the type (for example the type is not recognized).
*/ */
Mantid::API::IRemoteJobManager_sptr Mantid::API::IRemoteJobManager_sptr
RemoteJobManagerFactoryImpl::create(const std::string baseURL, RemoteJobManagerFactoryImpl::create(const std::string &baseURL,
const std::string jobManagerType) const { const std::string &jobManagerType) const {
Mantid::API::IRemoteJobManager_sptr jm; Mantid::API::IRemoteJobManager_sptr jm;
// use the inherited/generic create method // use the inherited/generic create method
......
...@@ -284,7 +284,7 @@ std::size_t Sample::size() const { return m_samples.size() + 1; } ...@@ -284,7 +284,7 @@ std::size_t Sample::size() const { return m_samples.size() + 1; }
* Adds a sample to the sample collection * Adds a sample to the sample collection
* @param childSample The child sample to be added * @param childSample The child sample to be added
*/ */
void Sample::addSample(boost::shared_ptr<Sample> childSample) { void Sample::addSample(const boost::shared_ptr<Sample> &childSample) {
m_samples.emplace_back(childSample); m_samples.emplace_back(childSample);
} }
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
// NScD Oak Ridge National Laboratory, European Spallation Source, // NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/ScopedWorkspace.h" #include <utility>
#include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/ScopedWorkspace.h"
#include "MantidAPI/WorkspaceGroup.h" #include "MantidAPI/WorkspaceGroup.h"
namespace Mantid { namespace Mantid {
...@@ -22,9 +24,9 @@ ScopedWorkspace::ScopedWorkspace() : m_name(generateUniqueName()) {} ...@@ -22,9 +24,9 @@ ScopedWorkspace::ScopedWorkspace() : m_name(generateUniqueName()) {}
/** /**
* Workspace constructor * Workspace constructor
*/ */
ScopedWorkspace::ScopedWorkspace(Workspace_sptr ws) ScopedWorkspace::ScopedWorkspace(const Workspace_sptr &ws)
: m_name(generateUniqueName()) { : m_name(generateUniqueName()) {
set(ws); set(std::move(ws));
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
...@@ -77,7 +79,7 @@ void ScopedWorkspace::remove() { ...@@ -77,7 +79,7 @@ void ScopedWorkspace::remove() {
/** /**
* Make ADS entry to point to the given workspace. * Make ADS entry to point to the given workspace.
*/ */
void ScopedWorkspace::set(Workspace_sptr newWS) { void ScopedWorkspace::set(const Workspace_sptr &newWS) {
AnalysisDataServiceImpl &ads = AnalysisDataService::Instance(); AnalysisDataServiceImpl &ads = AnalysisDataService::Instance();
if (!newWS->getName().empty() && ads.doesExist(newWS->getName())) if (!newWS->getName().empty() && ads.doesExist(newWS->getName()))
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <boost/range/algorithm/remove_if.hpp> #include <boost/range/algorithm/remove_if.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <set> #include <set>
#include <utility>
namespace Mantid { namespace Mantid {
namespace API { namespace API {
...@@ -36,14 +37,15 @@ Mantid::Kernel::Logger g_log("ScriptBuilder"); ...@@ -36,14 +37,15 @@ Mantid::Kernel::Logger g_log("ScriptBuilder");
const std::string COMMENT_ALG = "Comment"; const std::string COMMENT_ALG = "Comment";
ScriptBuilder::ScriptBuilder( ScriptBuilder::ScriptBuilder(
boost::shared_ptr<HistoryView> view, std::string versionSpecificity, const boost::shared_ptr<HistoryView> &view, std::string versionSpecificity,
bool appendTimestamp, std::vector<std::string> ignoreTheseAlgs, bool appendTimestamp, std::vector<std::string> ignoreTheseAlgs,
std::vector<std::vector<std::string>> ignoreTheseAlgProperties, std::vector<std::vector<std::string>> ignoreTheseAlgProperties,
bool appendExecCount) bool appendExecCount)
: m_historyItems(view->getAlgorithmsList()), m_output(), : m_historyItems(view->getAlgorithmsList()), m_output(),
m_versionSpecificity(versionSpecificity), m_versionSpecificity(std::move(versionSpecificity)),
m_timestampCommands(appendTimestamp), m_algsToIgnore(ignoreTheseAlgs), m_timestampCommands(appendTimestamp),
m_propertiesToIgnore(ignoreTheseAlgProperties), m_algsToIgnore(std::move(ignoreTheseAlgs)),
m_propertiesToIgnore(std::move(ignoreTheseAlgProperties)),
m_execCount(appendExecCount) {} m_execCount(appendExecCount) {}
/** /**
......
...@@ -15,7 +15,7 @@ namespace API { ...@@ -15,7 +15,7 @@ namespace API {
* @throws std::invalid_argument if a null workspace pointer is passed in * @throws std::invalid_argument if a null workspace pointer is passed in
*/ */
SpectrumDetectorMapping::SpectrumDetectorMapping( SpectrumDetectorMapping::SpectrumDetectorMapping(
MatrixWorkspace_const_sptr workspace, const bool useSpecNoIndex) const MatrixWorkspace_const_sptr &workspace, const bool useSpecNoIndex)
: m_indexIsSpecNo(useSpecNoIndex) { : m_indexIsSpecNo(useSpecNoIndex) {
if (!workspace) { if (!workspace) {
throw std::invalid_argument( throw std::invalid_argument(
......
...@@ -317,7 +317,7 @@ void WorkspaceHistory::loadNexus(::NeXus::File *file) { ...@@ -317,7 +317,7 @@ void WorkspaceHistory::loadNexus(::NeXus::File *file) {
* the workspace history. * the workspace history.
*/ */
void WorkspaceHistory::loadNestedHistory(::NeXus::File *file, void WorkspaceHistory::loadNestedHistory(::NeXus::File *file,
AlgorithmHistory_sptr parent) { const AlgorithmHistory_sptr &parent) {
// historyNumbers should be sorted by number // historyNumbers should be sorted by number
std::set<int> historyNumbers = findHistoryEntries(file); std::set<int> historyNumbers = findHistoryEntries(file);
for (auto historyNumber : historyNumbers) { for (auto historyNumber : historyNumbers) {
......
...@@ -141,7 +141,7 @@ template MANTID_API_DLL IMDHistoWorkspace_sptr executeBinaryOperation( ...@@ -141,7 +141,7 @@ template MANTID_API_DLL IMDHistoWorkspace_sptr executeBinaryOperation(
* @param tolerance :: acceptable difference for floating point numbers * @param tolerance :: acceptable difference for floating point numbers
* @return bool, true if workspaces match * @return bool, true if workspaces match
*/ */
bool equals(const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs, bool equals(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs,
double tolerance) { double tolerance) {
IAlgorithm_sptr alg = IAlgorithm_sptr alg =
AlgorithmManager::Instance().createUnmanaged("CompareWorkspaces"); AlgorithmManager::Instance().createUnmanaged("CompareWorkspaces");
...@@ -180,8 +180,8 @@ using OperatorOverloads::executeBinaryOperation; ...@@ -180,8 +180,8 @@ using OperatorOverloads::executeBinaryOperation;
* @param rhs :: right hand side workspace shared pointer * @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer * @return The result in a workspace shared pointer
*/ */
MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs, MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr rhs) { const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr, return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Plus", lhs, rhs); MatrixWorkspace_sptr>("Plus", lhs, rhs);
} }
...@@ -191,7 +191,7 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs, ...@@ -191,7 +191,7 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value * @param rhsValue :: the single value
* @return The result in a workspace shared pointer * @return The result in a workspace shared pointer
*/ */
MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs, MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr &lhs,
const double &rhsValue) { const double &rhsValue) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr, return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>( MatrixWorkspace_sptr>(
...@@ -203,8 +203,8 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs, ...@@ -203,8 +203,8 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
* @param rhs :: right hand side workspace shared pointer * @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer * @return The result in a workspace shared pointer
*/ */
MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs, MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr rhs) { const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr, return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Minus", lhs, rhs); MatrixWorkspace_sptr>("Minus", lhs, rhs);
} }
...@@ -214,7 +214,7 @@ MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs, ...@@ -214,7 +214,7 @@ MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value * @param rhsValue :: the single value
* @return The result in a workspace shared pointer * @return The result in a workspace shared pointer
*/ */
MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs, MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr &lhs,
const double &rhsValue) { const double