MCPcopy Create free account
hub / github.com/apache/cloudberry / inner_int_contains

Function inner_int_contains

contrib/intarray/_int_tool.c:13–45  ·  view source on GitHub ↗

arguments are assumed sorted & unique-ified */

Source from the content-addressed store, hash-verified

11
12/* arguments are assumed sorted & unique-ified */
13bool
14inner_int_contains(ArrayType *a, ArrayType *b)
15{
16 int na,
17 nb;
18 int i,
19 j,
20 n;
21 int *da,
22 *db;
23
24 na = ARRNELEMS(a);
25 nb = ARRNELEMS(b);
26 da = ARRPTR(a);
27 db = ARRPTR(b);
28
29 i = j = n = 0;
30 while (i < na && j < nb)
31 {
32 if (da[i] < db[j])
33 i++;
34 else if (da[i] == db[j])
35 {
36 n++;
37 i++;
38 j++;
39 }
40 else
41 break; /* db[j] is not in da */
42 }
43
44 return (n == nb) ? true : false;
45}
46
47/* arguments are assumed sorted */
48bool

Callers 2

g_int_consistentFunction · 0.85
_int_containsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected