Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcec916f

Browse files
committed
Remove unused "m" field in LSEG.
This field has been unreferenced since 1998, and does not appear in lsegvalues stored on disk (since sizeof(lseg) is only 32 bytes according topg_type). There was apparently some idea of maintaining it just in valuesappearing in memory, but the bookkeeping required to make that work wouldsurely far outweigh the cost of recalculating the line's slope when needed.Remove it to (a) simplify matters and (b) suppress some uninitialized-fieldwhining from Coverity.
1 parent4fe384b commitcec916f

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

‎src/backend/utils/adt/geo_ops.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,10 +2019,6 @@ lseg_in(PG_FUNCTION_ARGS)
20192019
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
20202020
errmsg("invalid input syntax for type lseg: \"%s\"",str)));
20212021

2022-
#ifdefNOT_USED
2023-
lseg->m=point_sl(&lseg->p[0],&lseg->p[1]);
2024-
#endif
2025-
20262022
PG_RETURN_LSEG_P(lseg);
20272023
}
20282024

@@ -2051,10 +2047,6 @@ lseg_recv(PG_FUNCTION_ARGS)
20512047
lseg->p[1].x=pq_getmsgfloat8(buf);
20522048
lseg->p[1].y=pq_getmsgfloat8(buf);
20532049

2054-
#ifdefNOT_USED
2055-
lseg->m=point_sl(&lseg->p[0],&lseg->p[1]);
2056-
#endif
2057-
20582050
PG_RETURN_LSEG_P(lseg);
20592051
}
20602052

@@ -2091,10 +2083,6 @@ lseg_construct(PG_FUNCTION_ARGS)
20912083
result->p[1].x=pt2->x;
20922084
result->p[1].y=pt2->y;
20932085

2094-
#ifdefNOT_USED
2095-
result->m=point_sl(pt1,pt2);
2096-
#endif
2097-
20982086
PG_RETURN_LSEG_P(result);
20992087
}
21002088

@@ -2106,10 +2094,6 @@ statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2)
21062094
lseg->p[0].y=pt1->y;
21072095
lseg->p[1].x=pt2->x;
21082096
lseg->p[1].y=pt2->y;
2109-
2110-
#ifdefNOT_USED
2111-
lseg->m=point_sl(pt1,pt2);
2112-
#endif
21132097
}
21142098

21152099
Datum
@@ -2160,9 +2144,6 @@ lseg_parallel(PG_FUNCTION_ARGS)
21602144
LSEG*l1=PG_GETARG_LSEG_P(0);
21612145
LSEG*l2=PG_GETARG_LSEG_P(1);
21622146

2163-
#ifdefNOT_USED
2164-
PG_RETURN_BOOL(FPeq(l1->m,l2->m));
2165-
#endif
21662147
PG_RETURN_BOOL(FPeq(point_sl(&l1->p[0],&l1->p[1]),
21672148
point_sl(&l2->p[0],&l2->p[1])));
21682149
}

‎src/include/utils/geo_decls.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ typedef struct
6868
typedefstruct
6969
{
7070
Pointp[2];
71-
72-
doublem;/* precomputed to save time, not in tuple */
7371
}LSEG;
7472

7573

‎src/test/regress/regress.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2)
212212
lseg->p[0].y=pt1->y;
213213
lseg->p[1].x=pt2->x;
214214
lseg->p[1].y=pt2->y;
215-
lseg->m=point_sl(pt1,pt2);
216215
}
217216

218217
PG_FUNCTION_INFO_V1(overpaid);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp