Skip to content

Commit 6a4ccb9

Browse files
committed
clang-tidy: Fix readability-redundant-casting warning
1 parent 2ff85d8 commit 6a4ccb9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/coastline_polygons.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void CoastlinePolygons::split_geometry(std::unique_ptr<OGRGeometry>&& geom, int
126126
} else if (geom->getGeometryType() == wkbMultiPolygon) {
127127
const auto mp = static_cast_unique_ptr<OGRMultiPolygon>(std::move(geom));
128128
while (mp->getNumGeometries() > 0) {
129-
std::unique_ptr<OGRPolygon> polygon{static_cast<OGRPolygon*>(mp->getGeometryRef(0))};
129+
std::unique_ptr<OGRPolygon> polygon{mp->getGeometryRef(0)};
130130
mp->removeGeometry(0, false);
131131
polygon->assignSpatialReference(srs.out());
132132
split_polygon(std::move(polygon), level);
@@ -347,7 +347,7 @@ void CoastlinePolygons::split_bbox(const OGREnvelope& envelope, polygon_vector_t
347347
case wkbMultiPolygon: {
348348
auto mp = static_cast_unique_ptr<OGRMultiPolygon>(std::move(geom));
349349
for (int i = mp->getNumGeometries() - 1; i >= 0; --i) {
350-
auto p = std::unique_ptr<OGRPolygon>(static_cast<OGRPolygon*>(mp->getGeometryRef(i)));
350+
auto p = std::unique_ptr<OGRPolygon>(mp->getGeometryRef(i));
351351
assert(p);
352352
mp->removeGeometry(i, FALSE);
353353
p->assignSpatialReference(mp->getSpatialReference());
@@ -428,7 +428,7 @@ void CoastlinePolygons::split_bbox(const OGREnvelope& envelope, polygon_vector_t
428428
const bool e2_intersects_e = e2.Intersects(polygon_envelope);
429429

430430
if (e1_intersects_e && e2_intersects_e) {
431-
v1.emplace_back(static_cast<OGRPolygon*>(polygon->clone()));
431+
v1.emplace_back(polygon->clone());
432432
v2.push_back(std::move(polygon));
433433
} else if (e1_intersects_e) {
434434
v1.push_back(std::move(polygon));

0 commit comments

Comments
 (0)