From: Paul Ramsey Date: Fri, 8 Mar 2019 16:35:05 +0000 (+0000) Subject: Move datum declaration closer to use X-Git-Tag: 3.0.0alpha1~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3d37dd4c7cb513b1467eec1453fe0448a7cb072;p=postgis Move datum declaration closer to use git-svn-id: http://svn.osgeo.org/postgis/trunk@17303 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/geography_measurement.c b/postgis/geography_measurement.c index 59f8a9376..818b3af2b 100644 --- a/postgis/geography_measurement.c +++ b/postgis/geography_measurement.c @@ -841,12 +841,7 @@ Datum geography_bestsrid(PG_FUNCTION_ARGS) int empty2 = LW_FALSE; double xwidth, ywidth; POINT2D center; - Datum d1 = PG_GETARG_DATUM(0); - Datum d2; - - if (PG_NARGS() > 1) - d2 = PG_GETARG_DATUM(1); /* Get our geometry objects loaded into memory. */ g1 = (GSERIALIZED*)PG_DETOAST_DATUM(d1); @@ -863,6 +858,7 @@ Datum geography_bestsrid(PG_FUNCTION_ARGS) /* If we have a unique second argument, fill in all the necessary variables. */ if (PG_NARGS() > 1) { + Datum d2 = PG_GETARG_DATUM(1); g2 = (GSERIALIZED*)PG_DETOAST_DATUM(d2); gbox2.flags = g2->flags; empty2 = gserialized_is_empty(g2);