Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c1f39437
Commit
c1f39437
authored
May 10, 2006
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some optimizations by Volkan YAZICI <yazicivo@ttnet.net.tr>
parent
10dd8df6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
contrib/intarray/_int_op.c
contrib/intarray/_int_op.c
+3
-2
contrib/intarray/_int_tool.c
contrib/intarray/_int_tool.c
+14
-17
No files found.
contrib/intarray/_int_op.c
View file @
c1f39437
...
...
@@ -83,8 +83,6 @@ _int_same(PG_FUNCTION_ARGS)
if
(
avoid
||
bvoid
)
return
(
avoid
&&
bvoid
)
?
TRUE
:
FALSE
;
SORT
(
a
);
SORT
(
b
);
na
=
ARRNELEMS
(
a
);
nb
=
ARRNELEMS
(
b
);
da
=
ARRPTR
(
a
);
...
...
@@ -94,7 +92,10 @@ _int_same(PG_FUNCTION_ARGS)
if
(
na
==
nb
)
{
SORT
(
a
);
SORT
(
b
);
result
=
TRUE
;
for
(
n
=
0
;
n
<
na
;
n
++
)
if
(
da
[
n
]
!=
db
[
n
])
{
...
...
contrib/intarray/_int_tool.c
View file @
c1f39437
...
...
@@ -34,7 +34,7 @@ inner_int_contains(ArrayType *a, ArrayType *b)
j
++
;
}
else
j
++
;
break
;
return
(
n
==
nb
)
?
TRUE
:
FALSE
;
}
...
...
@@ -76,13 +76,6 @@ ArrayType *
inner_int_union
(
ArrayType
*
a
,
ArrayType
*
b
)
{
ArrayType
*
r
=
NULL
;
int
na
,
nb
;
int
*
da
,
*
db
,
*
dr
;
int
i
,
j
;
CHECKARRVALID
(
a
);
CHECKARRVALID
(
b
);
...
...
@@ -94,31 +87,35 @@ inner_int_union(ArrayType *a, ArrayType *b)
if
(
ARRISVOID
(
b
))
r
=
copy_intArrayType
(
a
);
if
(
r
)
dr
=
ARRPTR
(
r
);
else
if
(
!
r
)
{
na
=
ARRNELEMS
(
a
);
nb
=
ARRNELEMS
(
b
);
da
=
ARRPTR
(
a
);
db
=
ARRPTR
(
b
);
int
na
=
ARRNELEMS
(
a
),
nb
=
ARRNELEMS
(
b
);
int
*
da
=
ARRPTR
(
a
),
*
db
=
ARRPTR
(
b
);
int
i
,
j
,
*
dr
;
r
=
new_intArrayType
(
na
+
nb
);
dr
=
ARRPTR
(
r
);
/* union */
i
=
j
=
0
;
while
(
i
<
na
&&
j
<
nb
)
if
(
da
[
i
]
<
db
[
j
])
while
(
i
<
na
&&
j
<
nb
)
{
if
(
da
[
i
]
==
db
[
j
])
{
*
dr
++
=
da
[
i
++
];
j
++
;
}
else
if
(
da
[
i
]
<
db
[
j
])
*
dr
++
=
da
[
i
++
];
else
*
dr
++
=
db
[
j
++
];
}
while
(
i
<
na
)
*
dr
++
=
da
[
i
++
];
while
(
j
<
nb
)
*
dr
++
=
db
[
j
++
];
r
=
resize_intArrayType
(
r
,
dr
-
ARRPTR
(
r
));
}
if
(
ARRNELEMS
(
r
)
>
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment