Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
396571d7
Commit
396571d7
authored
26 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Very minor cleanup of no-op code.
parent
9b24e7fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/utils/adt/geo_ops.c
+9
-66
9 additions, 66 deletions
src/backend/utils/adt/geo_ops.c
with
9 additions
and
66 deletions
src/backend/utils/adt/geo_ops.c
+
9
−
66
View file @
396571d7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.3
8
1998/10/2
6 01:01:33 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.3
9
1998/10/2
9 18:11:28 thomas
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2733,18 +2733,6 @@ on_pb(Point *pt, BOX *box)
bool
on_ppath
(
Point
*
pt
,
PATH
*
path
)
{
#if FALSE
int
above
,
next
,
/* is the seg above the ray? */
inter
,
/* # of times path crosses ray */
hi
;
/* index inc of higher seg (0,1) */
double
x
,
yh
,
yl
,
xh
,
xl
;
#endif
int
i
,
n
;
double
a
,
...
...
@@ -2753,8 +2741,9 @@ on_ppath(Point *pt, PATH *path)
if
(
!
PointerIsValid
(
pt
)
||
!
PointerIsValid
(
path
))
return
FALSE
;
/*-- OPEN --*/
if
(
!
path
->
closed
)
{
/*-- OPEN --*/
{
n
=
path
->
npts
-
1
;
a
=
point_dt
(
pt
,
&
path
->
p
[
0
]);
for
(
i
=
0
;
i
<
n
;
i
++
)
...
...
@@ -2768,58 +2757,8 @@ on_ppath(Point *pt, PATH *path)
return
FALSE
;
}
/*-- CLOSED --*/
return
point_inside
(
pt
,
path
->
npts
,
path
->
p
);
#if FALSE
inter
=
0
;
/*-- CLOSED --*/
above
=
FPgt
(
path
->
p
[
0
].
y
,
pt
->
y
)
?
ABOVE
:
FPlt
(
path
->
p
[
0
].
y
,
pt
->
y
)
?
BELOW
:
UNDEF
;
for
(
i
=
0
;
i
<
path
->
npts
;
i
++
)
{
hi
=
path
->
p
[
i
].
y
<
path
->
p
[
NEXT
(
i
)].
y
;
/*
* must take care of wrap around to original vertex for closed
* paths
*/
yh
=
(
i
+
hi
<
path
->
npts
)
?
path
->
p
[
i
+
hi
].
y
:
path
->
p
[
0
].
y
;
yl
=
(
i
+
!
hi
<
path
->
npts
)
?
path
->
p
[
i
+
!
hi
].
y
:
path
->
p
[
0
].
y
;
hi
=
path
->
p
[
i
].
x
<
path
->
p
[
NEXT
(
i
)].
x
;
xh
=
(
i
+
hi
<
path
->
npts
)
?
path
->
p
[
i
+
hi
].
x
:
path
->
p
[
0
].
x
;
xl
=
(
i
+
!
hi
<
path
->
npts
)
?
path
->
p
[
i
+
!
hi
].
x
:
path
->
p
[
0
].
x
;
/* skip seg if it doesn't touch the ray */
if
(
FPeq
(
yh
,
yl
))
/* horizontal seg? */
if
(
FPge
(
pt
->
x
,
xl
)
&&
FPle
(
pt
->
x
,
xh
)
&&
FPeq
(
pt
->
y
,
yh
))
return
TRUE
;
/* pt lies on seg */
else
continue
;
/* skip other hz segs */
if
(
FPlt
(
yh
,
pt
->
y
)
||
/* pt is strictly below seg */
FPgt
(
yl
,
pt
->
y
))
/* strictly above */
continue
;
/* seg touches the ray, find out where */
x
=
FPeq
(
xh
,
xl
)
/* vertical seg? */
?
path
->
p
[
i
].
x
:
(
pt
->
y
-
path
->
p
[
i
].
y
)
/
point_sl
(
&
path
->
p
[
i
],
&
path
->
p
[
NEXT
(
i
)])
+
path
->
p
[
i
].
x
;
if
(
FPeq
(
x
,
pt
->
x
))
/* pt lies on this seg */
return
TRUE
;
/* does the seg actually cross the ray? */
next
=
FPgt
(
path
->
p
[
NEXT
(
i
)].
y
,
pt
->
y
)
?
ABOVE
:
FPlt
(
path
->
p
[
NEXT
(
i
)].
y
,
pt
->
y
)
?
BELOW
:
above
;
inter
+=
FPge
(
x
,
pt
->
x
)
&&
next
!=
above
;
above
=
next
;
}
return
(
above
==
UNDEF
||
/* path is horizontal */
inter
%
2
);
/* odd # of intersections */
#endif
}
/* on_ppath() */
...
...
@@ -3577,9 +3516,13 @@ path_contain_pt(PATH *path, Point *p)
if
(
!
PointerIsValid
(
path
)
||
!
PointerIsValid
(
p
))
return
FALSE
;
return
(
path
->
closed
?
(
point_inside
(
p
,
path
->
npts
,
&
(
path
->
p
[
0
]))
!=
0
)
:
FALSE
);
return
(
on_ppath
(
p
,
path
)
);
}
/* path_contain_pt() */
/* pt_contained_path
* Point in or on path? This is the same as on_ppath.
* - thomas 1998-10-29
*/
bool
pt_contained_path
(
Point
*
p
,
PATH
*
path
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment