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

Appearance settings

Commit 6f62e61

Browse filesBrowse files
committed
Minor renaming and cleanup.
1 parent 2f851c9 commit 6f62e61
Copy full SHA for 6f62e61

File tree

2 files changed

+27
-23
lines changed
Filter options

2 files changed

+27
-23
lines changed

‎jsonb_gin_ops.c

Copy file name to clipboardExpand all lines: jsonb_gin_ops.c
+19-19Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,13 @@ make_gin_query_key_minus_inf(uint32 hash)
452452
}
453453

454454
static bool
455-
check_bloom_entry_handler(ExtractedNode *node, Pointer extra)
455+
check_value_path_entry_handler(ExtractedNode *node, Pointer extra)
456456
{
457457
return true;
458458
}
459459

460460
static int
461-
make_bloom_entry_handler(ExtractedNode *node, Pointer extra)
461+
make_value_path_entry_handler(ExtractedNode *node, Pointer extra)
462462
{
463463
Entries *e = (Entries *)extra;
464464
uint32 hash;
@@ -641,7 +641,7 @@ gin_compare_partial_jsonb_value_path(PG_FUNCTION_ARGS)
641641
}
642642

643643
static Datum *
644-
gin_extract_jsonb_bloom_value_internal(Jsonb *jb, int32 *nentries, uint32 **bloom)
644+
gin_extract_jsonb_value_path_internal(Jsonb *jb, int32 *nentries, uint32 **bloom)
645645
{
646646
int total = 2 * JB_ROOT_COUNT(jb);
647647
JsonbIterator *it;
@@ -730,7 +730,7 @@ gin_extract_jsonb_value_path(PG_FUNCTION_ARGS)
730730
Jsonb *jb = PG_GETARG_JSONB(0);
731731
int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
732732

733-
PG_RETURN_POINTER(gin_extract_jsonb_bloom_value_internal(jb, nentries, NULL));
733+
PG_RETURN_POINTER(gin_extract_jsonb_value_path_internal(jb, nentries, NULL));
734734
}
735735

736736
Datum
@@ -741,8 +741,8 @@ gin_debug_query_value_path(PG_FUNCTION_ARGS)
741741
char *s;
742742

743743
jq = PG_GETARG_JSQUERY(0);
744-
s = debugJsQuery(jq, make_bloom_entry_handler,
745-
check_bloom_entry_handler, (Pointer)&e);
744+
s = debugJsQuery(jq, make_value_path_entry_handler,
745+
check_value_path_entry_handler, (Pointer)&e);
746746
PG_RETURN_TEXT_P(cstring_to_text(s));
747747
}
748748

@@ -766,12 +766,12 @@ gin_extract_jsonb_query_value_path(PG_FUNCTION_ARGS)
766766
{
767767
case JsonbContainsStrategyNumber:
768768
jb = PG_GETARG_JSONB(0);
769-
entries = gin_extract_jsonb_bloom_value_internal(jb, nentries, NULL);
769+
entries = gin_extract_jsonb_value_path_internal(jb, nentries, NULL);
770770
break;
771771

772772
case JsonbNestedContainsStrategyNumber:
773773
jb = PG_GETARG_JSONB(0);
774-
entries = gin_extract_jsonb_bloom_value_internal(jb, nentries, &bloom);
774+
entries = gin_extract_jsonb_value_path_internal(jb, nentries, &bloom);
775775

776776
n = *nentries;
777777
*pmatch = (bool *) palloc(sizeof(bool) * n);
@@ -785,8 +785,8 @@ gin_extract_jsonb_query_value_path(PG_FUNCTION_ARGS)
785785

786786
case JsQueryMatchStrategyNumber:
787787
jq = PG_GETARG_JSQUERY(0);
788-
root = extractJsQuery(jq, make_bloom_entry_handler,
789-
check_bloom_entry_handler, (Pointer)&e);
788+
root = extractJsQuery(jq, make_value_path_entry_handler,
789+
check_value_path_entry_handler, (Pointer)&e);
790790
if (root)
791791
{
792792
*nentries = e.count;
@@ -958,7 +958,7 @@ get_query_path_hash(PathItem *pathItem, uint32 *hash)
958958
}
959959

960960
static bool
961-
check_hash_entry_handler(ExtractedNode *node, Pointer extra)
961+
check_path_value_entry_handler(ExtractedNode *node, Pointer extra)
962962
{
963963
uint32 hash;
964964
hash = 0;
@@ -968,7 +968,7 @@ check_hash_entry_handler(ExtractedNode *node, Pointer extra)
968968
}
969969

970970
static int
971-
make_hash_entry_handler(ExtractedNode *node, Pointer extra)
971+
make_path_value_entry_handler(ExtractedNode *node, Pointer extra)
972972
{
973973
Entries *e = (Entries *)extra;
974974
uint32 hash;
@@ -1073,7 +1073,7 @@ gin_compare_partial_jsonb_path_value(PG_FUNCTION_ARGS)
10731073
}
10741074

10751075
static Datum *
1076-
gin_extract_jsonb_hash_value_internal(Jsonb *jb, int32 *nentries)
1076+
gin_extract_jsonb_path_value_internal(Jsonb *jb, int32 *nentries)
10771077
{
10781078
int total = 2 * JB_ROOT_COUNT(jb);
10791079
JsonbIterator *it;
@@ -1159,7 +1159,7 @@ gin_extract_jsonb_path_value(PG_FUNCTION_ARGS)
11591159
Jsonb *jb = PG_GETARG_JSONB(0);
11601160
int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
11611161

1162-
PG_RETURN_POINTER(gin_extract_jsonb_hash_value_internal(jb, nentries));
1162+
PG_RETURN_POINTER(gin_extract_jsonb_path_value_internal(jb, nentries));
11631163
}
11641164

11651165
Datum
@@ -1170,8 +1170,8 @@ gin_debug_query_path_value(PG_FUNCTION_ARGS)
11701170
char *s;
11711171

11721172
jq = PG_GETARG_JSQUERY(0);
1173-
s = debugJsQuery(jq, make_hash_entry_handler,
1174-
check_hash_entry_handler, (Pointer)&e);
1173+
s = debugJsQuery(jq, make_path_value_entry_handler,
1174+
check_path_value_entry_handler, (Pointer)&e);
11751175
PG_RETURN_TEXT_P(cstring_to_text(s));
11761176
}
11771177

@@ -1194,13 +1194,13 @@ gin_extract_jsonb_query_path_value(PG_FUNCTION_ARGS)
11941194
{
11951195
case JsonbContainsStrategyNumber:
11961196
jb = PG_GETARG_JSONB(0);
1197-
entries = gin_extract_jsonb_hash_value_internal(jb, nentries);
1197+
entries = gin_extract_jsonb_path_value_internal(jb, nentries);
11981198
break;
11991199

12001200
case JsQueryMatchStrategyNumber:
12011201
jq = PG_GETARG_JSQUERY(0);
1202-
root = extractJsQuery(jq, make_hash_entry_handler,
1203-
check_hash_entry_handler, (Pointer)&e);
1202+
root = extractJsQuery(jq, make_path_value_entry_handler,
1203+
check_path_value_entry_handler, (Pointer)&e);
12041204
if (root)
12051205
{
12061206
*nentries = e.count;

‎jsquery_extract.c

Copy file name to clipboardExpand all lines: jsquery_extract.c
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ recursiveExtract(JsQueryItem *jsq, bool not, bool indirect, PathItem *path)
127127
jsqGetNext(jsq, &elem);
128128
return recursiveExtract(&elem, not, indirect, path);
129129
case jqiEqual:
130-
if (not) return NULL;
130+
if (not)
131+
return NULL;
131132
jsqGetArg(jsq, &e);
132133
if (e.type == jqiAny)
133134
{
@@ -154,7 +155,8 @@ recursiveExtract(JsQueryItem *jsq, bool not, bool indirect, PathItem *path)
154155
case jqiOverlap:
155156
case jqiContains:
156157
case jqiContained:
157-
if (not) return NULL;
158+
if (not)
159+
return NULL;
158160
result = (ExtractedNode *)palloc(sizeof(ExtractedNode));
159161
result->type = (jsq->type == jqiContains || jsq->type == jqiEqual) ? eAnd : eOr;
160162
jsqGetArg(jsq, &elem);
@@ -210,7 +212,8 @@ recursiveExtract(JsQueryItem *jsq, bool not, bool indirect, PathItem *path)
210212
case jqiGreater:
211213
case jqiLessOrEqual:
212214
case jqiGreaterOrEqual:
213-
if (not) return NULL;
215+
if (not)
216+
return NULL;
214217
result = (ExtractedNode *)palloc(sizeof(ExtractedNode));
215218
result->type = eInequality;
216219
result->hint = jsq->hint;
@@ -233,7 +236,8 @@ recursiveExtract(JsQueryItem *jsq, bool not, bool indirect, PathItem *path)
233236
}
234237
return result;
235238
case jqiIs:
236-
if (not) return NULL;
239+
if (not)
240+
return NULL;
237241
result = (ExtractedNode *)palloc(sizeof(ExtractedNode));
238242
result->type = eIs;
239243
result->hint = jsq->hint;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.