Skip to content

Commit

Permalink
Merge pull request #4180 from rouault/coverity_perf_warnings
Browse files Browse the repository at this point in the history
Fix Coverity Scan performance warnings (CID 463080, 463079, 463078, 463077)
  • Loading branch information
rouault authored Jun 24, 2024
2 parents 4aa1615 + c4e09c0 commit d73e829
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/iso19111/crs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ CRSNNPtr CRS::createBoundCRSToWGS84IfPossible(
auto extent1 = l_domains[1]->domainOfValidity();
if (extent0 && extent1) {
if (extent0->contains(NN_NO_CHECK(extent1))) {
extent = extent0;
extent = std::move(extent0);
} else if (extent1->contains(NN_NO_CHECK(extent0))) {
extent = extent1;
extent = std::move(extent1);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/iso19111/operation/coordinateoperationfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5360,8 +5360,10 @@ void CoordinateOperationFactory::Private::createOperationsVertToGeogSynthetized(
const auto dbContext =
authFactory ? authFactory->databaseContext().as_nullable() : nullptr;

const auto vertDatumName = vertSrc->datumNonNull(dbContext)->nameStr();
const auto geogDstDatumName = geogDst->datumNonNull(dbContext)->nameStr();
const auto vertDatum = vertSrc->datumNonNull(dbContext);
const auto &vertDatumName = vertDatum->nameStr();
const auto geogDstDatum = geogDst->datumNonNull(dbContext);
const auto &geogDstDatumName = geogDstDatum->nameStr();
// We accept a vertical CRS whose datum name is the same datum name as the
// source geographic CRS, or whose datum name is "Ellipsoid" if it is part
// of a CompoundCRS whose horizontal CRS has a geodetic datum of the same
Expand Down

0 comments on commit d73e829

Please sign in to comment.