summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane2015-02-03 21:50:50 +0000
committerTom Lane2015-02-03 21:53:32 +0000
commitcec916f35be5531efdaf721a46313feb36e0cd76 (patch)
treedd3f0aa010719dd9d12ec83de6c947aa7b55a763 /src
parent4fe384bd858671d40d311ca68cc9b80f4c683a3e (diff)
Remove unused "m" field in LSEG.
This field has been unreferenced since 1998, and does not appear in lseg values stored on disk (since sizeof(lseg) is only 32 bytes according to pg_type). There was apparently some idea of maintaining it just in values appearing in memory, but the bookkeeping required to make that work would surely far outweigh the cost of recalculating the line's slope when needed. Remove it to (a) simplify matters and (b) suppress some uninitialized-field whining from Coverity.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/geo_ops.c19
-rw-r--r--src/include/utils/geo_decls.h2
-rw-r--r--src/test/regress/regress.c1
3 files changed, 0 insertions, 22 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 0b13c400547..6b6510e8e2a 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -2019,10 +2019,6 @@ lseg_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type lseg: \"%s\"", str)));
-#ifdef NOT_USED
- lseg->m = point_sl(&lseg->p[0], &lseg->p[1]);
-#endif
-
PG_RETURN_LSEG_P(lseg);
}
@@ -2051,10 +2047,6 @@ lseg_recv(PG_FUNCTION_ARGS)
lseg->p[1].x = pq_getmsgfloat8(buf);
lseg->p[1].y = pq_getmsgfloat8(buf);
-#ifdef NOT_USED
- lseg->m = point_sl(&lseg->p[0], &lseg->p[1]);
-#endif
-
PG_RETURN_LSEG_P(lseg);
}
@@ -2091,10 +2083,6 @@ lseg_construct(PG_FUNCTION_ARGS)
result->p[1].x = pt2->x;
result->p[1].y = pt2->y;
-#ifdef NOT_USED
- result->m = point_sl(pt1, pt2);
-#endif
-
PG_RETURN_LSEG_P(result);
}
@@ -2106,10 +2094,6 @@ statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2)
lseg->p[0].y = pt1->y;
lseg->p[1].x = pt2->x;
lseg->p[1].y = pt2->y;
-
-#ifdef NOT_USED
- lseg->m = point_sl(pt1, pt2);
-#endif
}
Datum
@@ -2160,9 +2144,6 @@ lseg_parallel(PG_FUNCTION_ARGS)
LSEG *l1 = PG_GETARG_LSEG_P(0);
LSEG *l2 = PG_GETARG_LSEG_P(1);
-#ifdef NOT_USED
- PG_RETURN_BOOL(FPeq(l1->m, l2->m));
-#endif
PG_RETURN_BOOL(FPeq(point_sl(&l1->p[0], &l1->p[1]),
point_sl(&l2->p[0], &l2->p[1])));
}
diff --git a/src/include/utils/geo_decls.h b/src/include/utils/geo_decls.h
index 37bddc803f6..0b6d3c32d1d 100644
--- a/src/include/utils/geo_decls.h
+++ b/src/include/utils/geo_decls.h
@@ -68,8 +68,6 @@ typedef struct
typedef struct
{
Point p[2];
-
- double m; /* precomputed to save time, not in tuple */
} LSEG;
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index 621a10dfcfa..2e37d980af8 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -212,7 +212,6 @@ regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2)
lseg->p[0].y = pt1->y;
lseg->p[1].x = pt2->x;
lseg->p[1].y = pt2->y;
- lseg->m = point_sl(pt1, pt2);
}
PG_FUNCTION_INFO_V1(overpaid);