Skip to content

Commit c479021

Browse files
committed
f
1 parent c614496 commit c479021

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/geos_functions.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function cloneCoordSeq(ptr::GEOSCoordSeq, context::GEOSContext = get_global_cont
9797
end
9898

9999
function destroyCoordSeq(ptr::GEOSCoordSeq, context::GEOSContext = get_global_context())
100-
result = GEOSCoordSeq_destroy_r(context, ptr)
100+
o
101101
if result == C_NULL
102102
error("LibGEOS: Error in GEOSCoordSeq_destroy")
103103
end
@@ -1306,16 +1306,17 @@ Numbering is one-based.
13061306
For a simple geometry, returns a copy of the input.
13071307
"""
13081308
function getGeometry(obj::Geometry, n::Integer, context::GEOSContext = get_context(obj))
1309-
n in 1:numGeometries(obj, context) || error(
1310-
"GEOSGetGeometryN: $(numGeometries(obj, context)) sub-geometries in geom, therefore n should be in 1:$(numGeometries(obj, context))",
1311-
)
1309+
n in 1:numGeometries(obj, context) || _no_n_geom(obj, context, n)
13121310
result = GEOSGetGeometryN_r(context, obj, n - 1)
13131311
if result == C_NULL
13141312
error("LibGEOS: Error in GEOSGetGeometryN")
13151313
end
13161314
geomFromGEOS(cloneGeom(result, context), context)
13171315
end
13181316

1317+
@noinline _no_n_geom_error(obj, context, n) =
1318+
erroe("GEOSGetGeometryN: $(numGeometries(obj, context)) sub-geometries in geom, therefore n: $n should be in 1:$(numGeometries(obj, context))",)
1319+
13191320
"""
13201321
getGeometries(obj::Geometry, context::GEOSContext = get_context(obj))
13211322

0 commit comments

Comments
 (0)