Skip to content

Commit 00f4f6f

Browse files
Merge pull request #37885 from mantidproject/coverity_Warning
Fix latest coverity warnings
2 parents bdebbf4 + 9194466 commit 00f4f6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Framework/DataHandling/src/LoadNexusProcessed.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ API::Workspace_sptr LoadNexusProcessed::loadLeanElasticPeaksEntry(const NXEntry
10371037

10381038
for (int r = 0; r < numberPeaks; r++) {
10391039
// Create individual LeanElasticPeak
1040-
const auto goniometer = peakWS->run().getGoniometer();
1040+
const auto &goniometer = peakWS->run().getGoniometer();
10411041
LeanElasticPeak peak;
10421042
peak.setGoniometerMatrix(goniometer.getR());
10431043
peak.setRunNumber(peakWS->getRunNumber());
@@ -1319,7 +1319,7 @@ API::Workspace_sptr LoadNexusProcessed::loadPeaksEntry(const NXEntry &entry) {
13191319
// below this one) is set before QLabFrame as this causes Peak to ray trace
13201320
// to find the location of the detector, which significantly increases
13211321
// loading times.
1322-
const auto goniometer = peakWS->run().getGoniometer();
1322+
const auto &goniometer = peakWS->run().getGoniometer();
13231323
Peak peak;
13241324
peak.setInstrument(peakWS->getInstrument());
13251325
peak.setGoniometerMatrix(goniometer.getR());
@@ -1725,7 +1725,7 @@ API::MatrixWorkspace_sptr LoadNexusProcessed::loadNonEventEntry(NXData &wksp_cls
17251725

17261726
// now check for NaN at end of X which would signify ragged binning
17271727
for (size_t i = 0; i < local_workspace->getNumberHistograms(); i++) {
1728-
const auto x = local_workspace->readX(i);
1728+
const auto &x = local_workspace->readX(i);
17291729
const auto idx =
17301730
std::distance(x.rbegin(), std::find_if_not(x.rbegin(), x.rend(), [](auto val) { return std::isnan(val); }));
17311731
if (idx > 0)

qt/scientific_interfaces/Inelastic/Corrections/ContainerSubtraction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ContainerSubtraction::ContainerSubtraction(QWidget *parent) : CorrectionsTab(par
5151
ContainerSubtraction::~ContainerSubtraction() {
5252
m_uiForm.ppPreview->watchADS(false);
5353
if (m_transformedContainerWS) {
54-
auto const containerName = m_transformedContainerWS->getName();
54+
const auto &containerName = m_transformedContainerWS->getName();
5555

5656
// It is not safe to keep the signals connected
5757
(void)m_uiForm.dsContainer->disconnect();

0 commit comments

Comments
 (0)