Skip to content

Commit

Permalink
Re #8634. Take advantage of reference return type.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Dec 18, 2013
1 parent 0819435 commit b74c6ea
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/Algorithms/src/FitPeak.cpp
Expand Up @@ -107,8 +107,7 @@ namespace Algorithms
mustBeNonNegative->setLower(0);
declareProperty("WorkspaceIndex", 0, mustBeNonNegative, "Workspace index ");

std::vector<std::string> peakNames = FunctionFactory::Instance().getFunctionNames<IPeakFunction>();
vector<string> peakFullNames = addFunctionParameterNames(peakNames);
static vector<string> peakFullNames = addFunctionParameterNames(FunctionFactory::Instance().getFunctionNames<IPeakFunction>());
declareProperty("PeakFunctionType", "", boost::make_shared<StringListValidator>(peakFullNames),
"Peak function type. ");

Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/Algorithms/src/GeneratePeaks.cpp
Expand Up @@ -86,8 +86,7 @@ namespace Algorithms
this->declareProperty(new API::WorkspaceProperty<DataObjects::TableWorkspace>("PeakParametersWorkspace", "", Direction::Input),
"Input TableWorkspace for peak's parameters.");

std::vector<std::string> peakNames = FunctionFactory::Instance().getFunctionNames<API::IPeakFunction>();
this->declareProperty("PeakFunction", "Gaussian", boost::make_shared<StringListValidator>(peakNames),
this->declareProperty("PeakFunction", "Gaussian", boost::make_shared<StringListValidator>(FunctionFactory::Instance().getFunctionNames<API::IPeakFunction>()),
"Peak function to calculate.");

this->declareProperty(new API::WorkspaceProperty<API::MatrixWorkspace>("InputWorkspace", "", Direction::Input, PropertyMode::Optional),
Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/Algorithms/src/GetDetectorOffsets.cpp
Expand Up @@ -87,8 +87,7 @@ namespace Mantid
declareProperty(new WorkspaceProperty<>("MaskWorkspace","Mask",Direction::Output),
"An output workspace containing the mask.");
// Only keep peaks
std::vector<std::string> peakNames = FunctionFactory::Instance().getFunctionNames<IPeakFunction>();
declareProperty("PeakFunction", "Gaussian", boost::make_shared<StringListValidator>(peakNames));
declareProperty("PeakFunction", "Gaussian", boost::make_shared<StringListValidator>(FunctionFactory::Instance().getFunctionNames<IPeakFunction>()));
declareProperty("MaxOffset", 1.0, "Maximum absolute value of offsets; default is 1");
}

Expand Down
Expand Up @@ -30,7 +30,7 @@ namespace
*/
PyObject * getFunctionNames(FunctionFactoryImpl & self)
{
std::vector<std::string> names = self.getFunctionNames<Mantid::API::IFunction>();
const std::vector<std::string>& names = self.getFunctionNames<Mantid::API::IFunction>();

PyObject *registered = PyList_New(0);
for (auto name = names.begin(); name != names.end(); ++name)
Expand Down

0 comments on commit b74c6ea

Please sign in to comment.