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 @@
#include <algorithm>
#include <limits>
#include <sstream>
#include <utility>
namespace Mantid {
namespace API {
......@@ -87,7 +88,7 @@ boost::shared_ptr<IFunction> IFunction::clone() const {
*/
void IFunction::setProgressReporter(
boost::shared_ptr<Kernel::ProgressBase> reporter) {
m_progReporter = reporter;
m_progReporter = std::move(reporter);
m_progReporter->setNotifyStep(0.01);
}
......@@ -1241,8 +1242,9 @@ void IFunction::setMatrixWorkspace(
* @param wsIndex :: workspace index
* @return converted value
*/
double IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
boost::shared_ptr<const MatrixWorkspace> ws,
double
IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
const boost::shared_ptr<const MatrixWorkspace> &ws,
size_t wsIndex) const {
// only required if formula or look-up-table different from ws unit
const auto &wsUnit = ws->getAxis(0)->unit();
......@@ -1271,7 +1273,7 @@ double IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
*/
void IFunction::convertValue(std::vector<double> &values,
Kernel::Unit_sptr &outUnit,
boost::shared_ptr<const MatrixWorkspace> ws,
const boost::shared_ptr<const MatrixWorkspace> &ws,
size_t wsIndex) const {
// only required if formula or look-up-table different from ws unit
const auto &wsUnit = ws->getAxis(0)->unit();
......@@ -1448,7 +1450,7 @@ void IFunction::storeReadOnlyAttribute(
* @param covar :: A matrix to set.
*/
void IFunction::setCovarianceMatrix(
boost::shared_ptr<Kernel::Matrix<double>> covar) {
const boost::shared_ptr<Kernel::Matrix<double>> &covar) {
// the matrix shouldn't be empty
if (!covar) {
throw std::invalid_argument(
......
......@@ -12,6 +12,7 @@
#include "MantidKernel/VMD.h"
#include <sstream>
#include <utility>
using Mantid::Kernel::VMD;
......@@ -53,7 +54,7 @@ std::string IMDWorkspace::getConvention() const { return m_convention; }
/** @return the convention
*/
void IMDWorkspace::setConvention(std::string convention) {
m_convention = convention;
m_convention = std::move(convention);
}
//---------------------------------------------------------------------------------------------
......
......@@ -4,6 +4,8 @@
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include <utility>
#include "MantidAPI/IndexProperty.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidIndexing/GlobalSpectrumIndex.h"
......@@ -16,9 +18,10 @@ namespace API {
IndexProperty::IndexProperty(const std::string &name,
const IWorkspaceProperty &workspaceProp,
const IndexTypeProperty &indexTypeProp,
Kernel::IValidator_sptr validator)
: ArrayProperty(name, "", validator), m_workspaceProp(workspaceProp),
m_indexTypeProp(indexTypeProp), m_indices(0), m_indicesExtracted(false) {}
const Kernel::IValidator_sptr &validator)
: ArrayProperty(name, "", std::move(validator)),
m_workspaceProp(workspaceProp), m_indexTypeProp(indexTypeProp),
m_indices(0), m_indicesExtracted(false) {}
IndexProperty *IndexProperty::clone() const { return new IndexProperty(*this); }
......
......@@ -33,7 +33,7 @@ const FunctionDomain &JointDomain::getDomain(size_t i) const {
* Add a new 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);
}
......
......@@ -14,6 +14,7 @@
#include <Poco/NObserver.h>
#include <boost/make_shared.hpp>
#include <utility>
using namespace Mantid::Kernel;
using namespace Mantid::API;
......@@ -244,7 +245,7 @@ size_t MDGeometry::getDimensionIndexById(const std::string &id) const {
/** Add a dimension
* @param dim :: shared pointer to the dimension object */
void MDGeometry::addDimension(
boost::shared_ptr<Mantid::Geometry::IMDDimension> dim) {
const boost::shared_ptr<Mantid::Geometry::IMDDimension> &dim) {
m_dimensions.emplace_back(dim);
}
......@@ -382,7 +383,7 @@ void MDGeometry::setOriginalWorkspace(boost::shared_ptr<Workspace> ws,
size_t index) {
if (index >= m_originalWorkspaces.size())
m_originalWorkspaces.resize(index + 1);
m_originalWorkspaces[index] = ws;
m_originalWorkspaces[index] = std::move(ws);
m_notificationHelper->watchForWorkspaceDeletions();
}
......
......@@ -36,7 +36,7 @@ MultiPeriodGroupWorker::MultiPeriodGroupWorker(
* @param vecWorkspaceGroups: Vector of non-multi period workspace groups.
*/
void MultiPeriodGroupWorker::tryAddInputWorkspaceToInputGroups(
Workspace_sptr ws,
const Workspace_sptr &ws,
MultiPeriodGroupWorker::VecWSGroupType &vecMultiPeriodWorkspaceGroups,
MultiPeriodGroupWorker::VecWSGroupType &vecWorkspaceGroups) const {
WorkspaceGroup_sptr inputGroup =
......
......@@ -11,6 +11,7 @@
#include <boost/make_shared.hpp>
#include <sstream>
#include <utility>
using namespace Mantid::Kernel;
using namespace Mantid::API;
......@@ -62,7 +63,8 @@ MultipleExperimentInfos::getExperimentInfo(const uint16_t runIndex) const {
* @return the runIndex at which it was added
* @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);
if (m_expInfos.size() >=
static_cast<size_t>(std::numeric_limits<uint16_t>::max()))
......@@ -82,7 +84,7 @@ void MultipleExperimentInfos::setExperimentInfo(const uint16_t runIndex,
if (size_t(runIndex) >= m_expInfos.size())
throw std::invalid_argument(
"MDEventWorkspace::setExperimentInfo(): runIndex is out of range.");
m_expInfos[runIndex] = ei;
m_expInfos[runIndex] = std::move(ei);
}
//-----------------------------------------------------------------------------------------------
......
......@@ -14,6 +14,7 @@
#include "MantidKernel/Property.h"
#include <boost/utility.hpp>
#include <utility>
namespace Mantid {
namespace API {
......@@ -25,10 +26,10 @@ namespace {
Mantid::Kernel::Logger g_log("NotebookBuilder");
}
NotebookBuilder::NotebookBuilder(boost::shared_ptr<HistoryView> view,
NotebookBuilder::NotebookBuilder(const boost::shared_ptr<HistoryView> &view,
std::string versionSpecificity)
: m_historyItems(view->getAlgorithmsList()), m_output(),
m_versionSpecificity(versionSpecificity),
m_versionSpecificity(std::move(versionSpecificity)),
m_nb_writer(new NotebookWriter()) {}
/**
......@@ -39,9 +40,9 @@ NotebookBuilder::NotebookBuilder(boost::shared_ptr<HistoryView> view,
* @param ws_comment :: workspace comment
* @return a formatted ipython notebook string of the history
*/
const std::string NotebookBuilder::build(std::string ws_name,
std::string ws_title,
std::string ws_comment) {
const std::string NotebookBuilder::build(const std::string &ws_name,
const std::string &ws_title,
const std::string &ws_comment) {
// record workspace details in notebook
std::string workspace_details;
workspace_details = "Workspace History: " + ws_name + "\n";
......@@ -109,8 +110,8 @@ void NotebookBuilder::buildChildren(
* @param algHistory :: pointer to an algorithm history object
* @returns std::string to run this algorithm
*/
const std::string
NotebookBuilder::buildAlgorithmString(AlgorithmHistory_const_sptr algHistory) {
const std::string NotebookBuilder::buildAlgorithmString(
const AlgorithmHistory_const_sptr &algHistory) {
std::ostringstream properties;
const std::string name = algHistory->name();
std::string prop;
......@@ -159,8 +160,8 @@ NotebookBuilder::buildAlgorithmString(AlgorithmHistory_const_sptr algHistory) {
* @param propHistory :: reference to a property history object
* @returns std::string for this property
*/
const std::string
NotebookBuilder::buildPropertyString(PropertyHistory_const_sptr propHistory) {
const std::string NotebookBuilder::buildPropertyString(
const PropertyHistory_const_sptr &propHistory) {
using Mantid::Kernel::Direction;
// Create a vector of all non workspace property type names
......
......@@ -4,6 +4,8 @@
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include <utility>
#include "MantidAPI/NotebookWriter.h"
#include "MantidKernel/Logger.h"
#include "MantidKernel/MantidVersion.h"
......@@ -34,7 +36,7 @@ void NotebookWriter::codeCell(Json::Value array_code) {
cell_data["cell_type"] = "code";
cell_data["collapsed"] = false;
cell_data["input"] = array_code;
cell_data["input"] = std::move(array_code);
cell_data["language"] = "python";
cell_data["metadata"] = empty;
cell_data["outputs"] = Json::Value(Json::arrayValue);
......@@ -47,7 +49,7 @@ void NotebookWriter::codeCell(Json::Value array_code) {
*
* @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;
const Json::Value empty = Json::Value(Json::ValueType::objectValue);
......@@ -77,7 +79,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) {
cell_data["cell_type"] = "markdown";
cell_data["metadata"] = empty;
cell_data["source"] = string_array;
cell_data["source"] = std::move(string_array);
m_cell_buffer.append(cell_data);
}
......@@ -87,7 +89,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) {
*
* @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;
const Json::Value empty = Json::Value(Json::ValueType::objectValue);
......
......@@ -65,8 +65,8 @@ IRemoteJobManager_sptr RemoteJobManagerFactoryImpl::create(
* the type (for example the type is not recognized).
*/
Mantid::API::IRemoteJobManager_sptr
RemoteJobManagerFactoryImpl::create(const std::string baseURL,
const std::string jobManagerType) const {
RemoteJobManagerFactoryImpl::create(const std::string &baseURL,
const std::string &jobManagerType) const {
Mantid::API::IRemoteJobManager_sptr jm;
// use the inherited/generic create method
......
......@@ -284,7 +284,7 @@ std::size_t Sample::size() const { return m_samples.size() + 1; }
* Adds a sample to the sample collection
* @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);
}
......
......@@ -4,8 +4,10 @@
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/ScopedWorkspace.h"
#include <utility>
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/ScopedWorkspace.h"
#include "MantidAPI/WorkspaceGroup.h"
namespace Mantid {
......@@ -22,9 +24,9 @@ ScopedWorkspace::ScopedWorkspace() : m_name(generateUniqueName()) {}
/**
* Workspace constructor
*/
ScopedWorkspace::ScopedWorkspace(Workspace_sptr ws)
ScopedWorkspace::ScopedWorkspace(const Workspace_sptr &ws)
: m_name(generateUniqueName()) {
set(ws);
set(std::move(ws));
}
//----------------------------------------------------------------------------------------------
......@@ -77,7 +79,7 @@ void ScopedWorkspace::remove() {
/**
* 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();
if (!newWS->getName().empty() && ads.doesExist(newWS->getName()))
......
......@@ -22,6 +22,7 @@
#include <boost/range/algorithm/remove_if.hpp>
#include <boost/utility.hpp>
#include <set>
#include <utility>
namespace Mantid {
namespace API {
......@@ -36,14 +37,15 @@ Mantid::Kernel::Logger g_log("ScriptBuilder");
const std::string COMMENT_ALG = "Comment";
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,
std::vector<std::vector<std::string>> ignoreTheseAlgProperties,
bool appendExecCount)
: m_historyItems(view->getAlgorithmsList()), m_output(),
m_versionSpecificity(versionSpecificity),
m_timestampCommands(appendTimestamp), m_algsToIgnore(ignoreTheseAlgs),
m_propertiesToIgnore(ignoreTheseAlgProperties),
m_versionSpecificity(std::move(versionSpecificity)),
m_timestampCommands(appendTimestamp),
m_algsToIgnore(std::move(ignoreTheseAlgs)),
m_propertiesToIgnore(std::move(ignoreTheseAlgProperties)),
m_execCount(appendExecCount) {}
/**
......
......@@ -15,7 +15,7 @@ namespace API {
* @throws std::invalid_argument if a null workspace pointer is passed in
*/
SpectrumDetectorMapping::SpectrumDetectorMapping(
MatrixWorkspace_const_sptr workspace, const bool useSpecNoIndex)
const MatrixWorkspace_const_sptr &workspace, const bool useSpecNoIndex)
: m_indexIsSpecNo(useSpecNoIndex) {
if (!workspace) {
throw std::invalid_argument(
......
......@@ -317,7 +317,7 @@ void WorkspaceHistory::loadNexus(::NeXus::File *file) {
* the workspace history.
*/
void WorkspaceHistory::loadNestedHistory(::NeXus::File *file,
AlgorithmHistory_sptr parent) {
const AlgorithmHistory_sptr &parent) {
// historyNumbers should be sorted by number
std::set<int> historyNumbers = findHistoryEntries(file);
for (auto historyNumber : historyNumbers) {
......
......@@ -141,7 +141,7 @@ template MANTID_API_DLL IMDHistoWorkspace_sptr executeBinaryOperation(
* @param tolerance :: acceptable difference for floating point numbers
* @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) {
IAlgorithm_sptr alg =
AlgorithmManager::Instance().createUnmanaged("CompareWorkspaces");
......@@ -180,8 +180,8 @@ using OperatorOverloads::executeBinaryOperation;
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Plus", lhs, rhs);
}
......@@ -191,7 +191,7 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -203,8 +203,8 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Minus", lhs, rhs);
}
......@@ -214,7 +214,7 @@ MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -227,7 +227,7 @@ MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator-(const double &lhsValue,
const MatrixWorkspace_sptr rhs) {
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
"Minus", createWorkspaceSingleValue(lhsValue), rhs);
......@@ -237,8 +237,8 @@ MatrixWorkspace_sptr operator-(const double &lhsValue,
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Multiply", lhs, rhs);
}
......@@ -248,7 +248,7 @@ MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -262,7 +262,7 @@ MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr lhs,
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator*(const double &lhsValue,
const MatrixWorkspace_sptr rhs) {
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
"Multiply", createWorkspaceSingleValue(lhsValue), rhs);
......@@ -273,8 +273,8 @@ MatrixWorkspace_sptr operator*(const double &lhsValue,
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Divide", lhs, rhs);
}
......@@ -284,7 +284,7 @@ MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -298,7 +298,7 @@ MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr lhs,
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator/(const double &lhsValue,
const MatrixWorkspace_sptr rhs) {
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
"Divide", createWorkspaceSingleValue(lhsValue), rhs);
......@@ -309,8 +309,8 @@ MatrixWorkspace_sptr operator/(const double &lhsValue,
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Plus", lhs, rhs, true);
}
......@@ -320,7 +320,7 @@ MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -332,8 +332,8 @@ MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr lhs,
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Minus", lhs, rhs, true);
}
......@@ -343,7 +343,7 @@ MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -355,8 +355,8 @@ MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr lhs,
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Multiply", lhs, rhs,
true);
......@@ -367,7 +367,7 @@ MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -379,8 +379,8 @@ MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr lhs,
* @param rhs :: right hand side workspace shared pointer
* @return The result in a workspace shared pointer
*/
MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr lhs,
const MatrixWorkspace_sptr rhs) {
MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr &lhs,
const MatrixWorkspace_sptr &rhs) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>("Divide", lhs, rhs, true);
}
......@@ -390,7 +390,7 @@ MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr lhs,
* @param rhsValue :: the single value
* @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) {
return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
MatrixWorkspace_sptr>(
......@@ -490,7 +490,7 @@ bool WorkspaceHelpers::sharedXData(const MatrixWorkspace &WS) {
* @param forwards :: If true (the default) divides by bin width, if false
* multiplies
*/
void WorkspaceHelpers::makeDistribution(MatrixWorkspace_sptr workspace,
void WorkspaceHelpers::makeDistribution(const MatrixWorkspace_sptr &workspace,
const bool forwards) {
// If we're not able to get a writable reference to Y, then this is an event
// workspace, which we can't operate on.
......
......@@ -239,7 +239,7 @@ private:
return AlgorithmHistory(&alg, execTime, 14.0, m_execCount++);
}
AlgorithmHistory createFromTestAlg(std::string paramValue) {
AlgorithmHistory createFromTestAlg(const std::string &paramValue) {
Algorithm *testInput = new testalg;
testInput->initialize();
testInput->setPropertyValue("arg1_param", paramValue);
......
......@@ -17,6 +17,7 @@
#include <Poco/Thread.h>
#include <boost/lexical_cast.hpp>
#include <utility>
using namespace Mantid::API;
using namespace Mantid::Kernel;
......@@ -121,7 +122,8 @@ public:
TestProxyObserver()
: AlgorithmObserver(), start(false), progress(false), finish(false) {}
TestProxyObserver(IAlgorithm_const_sptr alg)
: AlgorithmObserver(alg), start(false), progress(false), finish(false) {}
: AlgorithmObserver(std::move(alg)), start(false), progress(false),
finish(false) {}
void startHandle(const IAlgorithm *) override { start = true; }
void progressHandle(const IAlgorithm *, double p,
const std::string &msg) override {
......
......@@ -27,6 +27,7 @@
#include "MantidTestHelpers/FakeObjects.h"
#include "PropertyManagerHelper.h"
#include <map>
#include <utility>
using namespace Mantid::Kernel;
using namespace Mantid::API;
......@@ -511,8 +512,9 @@ public:
/** Test of setting read and/or write locks
* for various combinations of input/output workspaces.
*/
void do_test_locking(std::string in1, std::string in2, std::string inout,
std::string out1, std::string out2) {
void do_test_locking(const std::string &in1, const std::string &in2,
const std::string &inout, const std::string &out1,
const std::string &out2) {
for (size_t i = 0; i < 6; i++) {
boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
......@@ -586,7 +588,8 @@ public:
* Make no group if blank, just 1 workspace
* @return The new WorkspaceGroup object