From 23c75b55aaccddea79545ffaf1cbfc9f1edeaa8c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 16 Dec 2016 11:50:07 -0500 Subject: Improve documentation around TS_execute(). I got frustrated by the lack of commentary in this area, so here is some reverse-engineered documentation, along with minor stylistic cleanup. No code changes more significant than removal of unused variables. Back-patch to 9.6, not because that's useful in itself, but because we have some bugs to fix in phrase search and this would cause merge failures if it's only in HEAD. --- src/backend/utils/adt/tsginidx.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/backend/utils/adt/tsginidx.c') diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c index c953f531ff7..efc111e379c 100644 --- a/src/backend/utils/adt/tsginidx.c +++ b/src/backend/utils/adt/tsginidx.c @@ -188,7 +188,7 @@ checkcondition_gin_internal(GinChkVal *gcv, QueryOperand *val, ExecPhraseData *d * information then set recheck flag */ if (val->weight != 0 || data != NULL) - *gcv->need_recheck = true; + *(gcv->need_recheck) = true; /* convert item's number to corresponding entry's (operand's) number */ j = gcv->map_item_operand[((QueryItem *) val) - gcv->first_item]; @@ -289,19 +289,18 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS) bool *recheck = (bool *) PG_GETARG_POINTER(5); bool res = FALSE; - /* The query requires recheck only if it involves weights */ + /* Initially assume query doesn't require recheck */ *recheck = false; if (query->size > 0) { - QueryItem *item; GinChkVal gcv; /* * check-parameter array has one entry for each value (operand) in the * query. */ - gcv.first_item = item = GETQUERY(query); + gcv.first_item = GETQUERY(query); gcv.check = check; gcv.map_item_operand = (int *) (extra_data[0]); gcv.need_recheck = recheck; @@ -328,19 +327,18 @@ gin_tsquery_triconsistent(PG_FUNCTION_ARGS) GinTernaryValue res = GIN_FALSE; bool recheck; - /* The query requires recheck only if it involves weights */ + /* Initially assume query doesn't require recheck */ recheck = false; if (query->size > 0) { - QueryItem *item; GinChkVal gcv; /* * check-parameter array has one entry for each value (operand) in the * query. */ - gcv.first_item = item = GETQUERY(query); + gcv.first_item = GETQUERY(query); gcv.check = check; gcv.map_item_operand = (int *) (extra_data[0]); gcv.need_recheck = &recheck; -- cgit v1.2.3