Skip to content

Commit

Permalink
GRIDEDIT-953 FIxed several sonarcloud warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BillSenior committed Jun 18, 2024
1 parent 8d86872 commit 05edc2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 3 additions & 7 deletions libs/MeshKernel/include/MeshKernel/Operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,16 @@ namespace meshkernel

if (pointAdimensionalCoordinate - coordinate < eps)
{
return pointCoordinate = coordinates.at(static_cast<UInt>(coordinate));
// return pointCoordinate = coordinates[static_cast<UInt>(coordinate)];
return pointCoordinate = coordinates[static_cast<UInt>(coordinate)];
}

const UInt low = static_cast<UInt>(coordinate);
const UInt high = low + 1;
const double a = high - pointAdimensionalCoordinate;
const double b = pointAdimensionalCoordinate - low;

pointCoordinate = coordinates.at(low) * a + coordinates.at(high) * b +
(coordinatesDerivatives.at(low) * (pow(a, 3) - a) + coordinatesDerivatives.at(high) * (pow(b, 3) - b)) / 6.0 * splFac;

// pointCoordinate = coordinates[low] * a + coordinates[high] * b +
// (coordinatesDerivatives[low] * (pow(a, 3) - a) + coordinatesDerivatives[high] * (pow(b, 3) - b)) / 6.0 * splFac;
pointCoordinate = coordinates[low] * a + coordinates[high] * b +
(coordinatesDerivatives[low] * (pow(a, 3) - a) + coordinatesDerivatives[high] * (pow(b, 3) - b)) / 6.0 * splFac;

return pointCoordinate;
}
Expand Down
2 changes: 0 additions & 2 deletions libs/MeshKernel/tests/src/SplineTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,4 @@ TEST(Splines, SplineMultiIntersection)
bool crossing = splines.GetSplinesIntersection(0, 1, crossProductIntersection, dimensionalIntersection, firstSplineRatio, secondSplineRatio);

ASSERT_TRUE(crossing);

// const double tolerance = 1e-6;
}

0 comments on commit 05edc2f

Please sign in to comment.