Skip to content

Commit 0b8e5fe

Browse files
Merge pull request #38012 from mantidproject/diffraction_coverity_fixes
Coverity issue fixes
2 parents 6c3433c + 80dac2a commit 0b8e5fe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Framework/Algorithms/src/DiscusMultipleScatteringCorrection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ std::tuple<bool, std::vector<double>> DiscusMultipleScatteringCorrection::scatte
14411441
for (auto &SQWSMapping : currentComponentWorkspaces)
14421442
SQWSMapping.InvPOfQ = SQWSMapping.InvPOfQ->createCopy();
14431443
prepareCumulativeProbForQ(k, newComponentWorkspaces);
1444-
currentComponentWorkspaces = newComponentWorkspaces;
1444+
currentComponentWorkspaces = std::move(newComponentWorkspaces);
14451445
}
14461446
}
14471447
auto trackStillAlive =
@@ -1507,7 +1507,7 @@ std::tuple<bool, std::vector<double>> DiscusMultipleScatteringCorrection::scatte
15071507
const double q = qVector.norm();
15081508
const double finalW = fromWaveVector(k) - finalE;
15091509
auto componentWSIt = findMatchingComponent(componentWorkspaces, shapeObjectWithScatter);
1510-
auto componentWSMapping = *componentWSIt; // to help debugging
1510+
auto &componentWSMapping = *componentWSIt; // to help debugging
15111511
double SQ = Interpolate2D(componentWSMapping, q, finalW);
15121512
scatteringXSection = m_NormalizeSQ ? scatteringXSection / interpolateFlat(*(componentWSMapping.QSQScaleFactor), k)
15131513
: scatteringXSectionFull;

Framework/Crystal/src/RotateSampleShape.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ void RotateSampleShape::exec() {
7777
g_log.warning() << "Empty goniometer created; will always return an "
7878
"identity rotation matrix.\n";
7979

80-
const auto sampleShapeRotation = gon.getR();
80+
const auto &sampleShapeRotation = gon.getR();
8181
if (sampleShapeRotation == Kernel::Matrix<double>(3, 3, true)) {
8282
// If the resulting rotationMatrix is Identity, ignore the calculatrion
8383
g_log.warning("Rotation matrix set via RotateSampleShape is an Identity matrix. Ignored rotating sample shape");
8484
return;
8585
}
8686

87-
const auto oldRotation = ei->run().getGoniometer().getR();
87+
const auto &oldRotation = ei->run().getGoniometer().getR();
8888
auto newSampleShapeRot = sampleShapeRotation * oldRotation;
8989
if (isMeshShape) {
9090
auto meshShape = std::dynamic_pointer_cast<MeshObject>(ei->sample().getShapePtr());

0 commit comments

Comments
 (0)