Skip to content
Snippets Groups Projects
Commit c73b9094 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

uniform local var 'result', not 'ret'

parent fc1d92d2
No related branches found
No related tags found
2 merge requests!907Core cleanup,!905mv class Instrument out of core
......@@ -70,9 +70,9 @@ SpinMatrix SpinMatrix::operator*(const SpinMatrix& o) const
SpinMatrix SpinMatrix::operator*=(const SpinMatrix& o)
{
const SpinMatrix ret(*this * o);
*this = ret;
return ret;
const SpinMatrix tmp(*this * o);
*this = tmp;
return *this;
}
Spinor SpinMatrix::operator*(const Spinor& s) const
......
......@@ -25,10 +25,10 @@ std::vector<IAxis*> ICoordSystem::defaultAxes() const
std::vector<IAxis*> ICoordSystem::convertedAxes(Coords units) const
{
std::vector<IAxis*> ret;
std::vector<IAxis*> result;
for (size_t i = 0; i < rank(); ++i)
ret.emplace_back(createConvertedAxis(i, units));
return ret;
result.emplace_back(createConvertedAxis(i, units));
return result;
}
std::string ICoordSystem::axisName(size_t i_axis, const Coords units) const
......
......@@ -43,18 +43,18 @@ Powerfield<double>* IOFactory::readPowerfield(const std::string& file_name, Load
&& fileTypeMatchesLoaderSelector(file_name, testForSelector));
};
Powerfield<double>* ret = nullptr;
Powerfield<double>* result = nullptr;
if (readAs(bornagain))
ret = readPowerfield(file_name,
result = readPowerfield(file_name,
[](std::istream& s) { return ReadWriteINT().readPowerfield(s); });
else if (readAs(nicos))
ret = readPowerfield(file_name, [](std::istream& s) { return IO::readNicosData(s); });
result = readPowerfield(file_name, [](std::istream& s) { return IO::readNicosData(s); });
#ifdef BA_TIFF_SUPPORT
else if (readAs(tiff))
ret = readPowerfield(file_name,
result = readPowerfield(file_name,
[](std::istream& s) { return ReadWriteTiff().readPowerfield(s); });
#endif
......@@ -62,11 +62,11 @@ Powerfield<double>* IOFactory::readPowerfield(const std::string& file_name, Load
// Try to read ASCII by default. Binary maps to ASCII.
// If the file is not actually a matrix of numbers,
// the error will be thrown during the reading.
ret = readPowerfield(file_name,
result = readPowerfield(file_name,
[](std::istream& s) { return ReadWriteNumpyTXT().readPowerfield(s); });
ASSERT(ret);
return ret;
ASSERT(result);
return result;
}
Powerfield<double>* IOFactory::readReflectometryData(const std::string& file_name)
......
......@@ -59,9 +59,9 @@ GUI::Model::DataViewUtils::getTranslatedData(Data1DViewItem* view_item, DataItem
auto* converter = getConverter(view_item);
auto current_units = selectedUnits(view_item);
auto ret = std::make_unique<Powerfield<double>>(converter->convertedAxes(current_units));
auto result = std::make_unique<Powerfield<double>>(converter->convertedAxes(current_units));
ret->setRawDataVector(data_item->getPowerfield()->getRawDataVector());
result->setRawDataVector(data_item->getPowerfield()->getRawDataVector());
return ret;
return result;
}
......@@ -64,28 +64,28 @@ Qt::ItemFlags FitParameterModel::flags(const QModelIndex& index) const
if (!m_parameterContainer)
return Qt::NoItemFlags;
Qt::ItemFlags returnVal = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
Qt::ItemFlags result = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
if (SessionItem* item = itemForIndex(index)) {
if (item->isEditable() && index.column() != COL_NAME)
returnVal |= Qt::ItemIsEditable;
result |= Qt::ItemIsEditable;
if (item->parent()->hasModelType<FitParameterLinkItem>() && index.column() == COL_NAME)
returnVal |= Qt::ItemIsDragEnabled;
result |= Qt::ItemIsDragEnabled;
const bool allow_one_fit_parameter_to_have_more_than_one_link = true;
if (allow_one_fit_parameter_to_have_more_than_one_link) {
// drop is allowed to fit parameter container, and, to FitParameterItem itself.
// (i.e. we can have more than one link in single FitParameterItem)
if (item->hasModelType<FitParameterItem>()
|| item->hasModelType<FitParameterContainerItem>()) {
returnVal |= Qt::ItemIsDropEnabled;
result |= Qt::ItemIsDropEnabled;
}
} else {
// drop is allowed only to fit parameter container
// (i.e. only one link is allowed in FitParameterItem)
if (item->hasModelType<FitParameterContainerItem>())
returnVal |= Qt::ItemIsDropEnabled;
result |= Qt::ItemIsDropEnabled;
}
}
return returnVal;
return result;
}
QModelIndex FitParameterModel::index(int row, int column, const QModelIndex& parent) const
......
......@@ -63,10 +63,10 @@ void ParticleLayout::addParticle(const IParticle& particle, double abundance)
std::vector<const IParticle*> ParticleLayout::particles() const
{
std::vector<const IParticle*> ret;
std::vector<const IParticle*> result;
for (const IParticle* p : m_particles)
ret.emplace_back(p);
return ret;
result.emplace_back(p);
return result;
}
const IInterference* ParticleLayout::interferenceFunction() const
......
......@@ -343,18 +343,18 @@ class Doxy2SWIG:
ret.append(i)
_data = "".join(ret)
ret = []
result = []
for i in _data.split('\n\n'):
if i == 'Parameters:':
ret.extend(['Parameters:\n-----------', '\n\n'])
result.extend(['Parameters:\n-----------', '\n\n'])
elif i.find('// File:') > -1: # leave comments alone.
ret.extend([i, '\n'])
result.extend([i, '\n'])
else:
#_tmp = textwrap.fill(i.strip())
_tmp = i.strip()
_tmp = self.lead_spc.sub(r'\1"\2', _tmp)
ret.extend([_tmp, '\n\n'])
return ret
result.extend([_tmp, '\n\n'])
return result
def main(input, output):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment