Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit9d16555

Browse files
committed
cosmetic code fixes
1 parentef0c701 commit9d16555

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

‎src/rum_ts_utils.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ static WordEntryPosVector POSNULL = {
171171
#defineRANK_NORM_RDIVRPLUS10x20
172172
#defineDEF_NORM_METHODRANK_NO_NORM
173173

174-
#defineTS_EXEC_IN_NEG 0x04
174+
/*
175+
* Should not conflict with defines
176+
* TS_EXEC_EMPTY/TS_EXEC_CALC_NOT/TS_EXEC_PHRASE_NO_POS
177+
*/
178+
#defineTS_EXEC_IN_NEG0x04
175179

176180
#defineQR_GET_OPERAND(q,v)\
177181
(&((q)->operandData[ ((QueryItem*)(v)) - GETQUERY((q)->query) ]))
@@ -197,10 +201,8 @@ Datum
197201
rum_tsquery_pre_consistent(PG_FUNCTION_ARGS)
198202
{
199203
bool*check= (bool*)PG_GETARG_POINTER(0);
200-
201204
TSQueryquery=PG_GETARG_TSQUERY(2);
202-
203-
Pointer*extra_data= (Pointer*)PG_GETARG_POINTER(4);
205+
Pointer*extra_data= (Pointer*)PG_GETARG_POINTER(4);
204206
boolrecheck;
205207
boolres= false;
206208

@@ -247,7 +249,6 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
247249
int32i;
248250
char*ptrt;
249251
WordEntryPospost;
250-
251252
post=0;
252253
int32npos;
253254
int32k=0;
@@ -267,9 +268,7 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
267268
/* caller wants an array of positions (phrase search) */
268269
if (data)
269270
{
270-
constint32itemsize=sizeof(*data->pos);
271-
272-
data->pos=palloc(itemsize*npos);
271+
data->pos=palloc(sizeof(*data->pos)*npos);
273272
data->allocated= true;
274273

275274
/* Fill positions that has right weight to return to a caller */
@@ -289,7 +288,7 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
289288
}
290289
}
291290
data->npos=k;
292-
data->pos=repalloc(data->pos,itemsize*k);
291+
data->pos=repalloc(data->pos,sizeof(*data->pos)*k);
293292
return (k ?TS_YES :TS_NO);
294293
}
295294

@@ -835,12 +834,10 @@ Datum
835834
rum_tsquery_consistent(PG_FUNCTION_ARGS)
836835
{
837836
bool*check= (bool*)PG_GETARG_POINTER(0);
838-
839837
/* StrategyNumber strategy = PG_GETARG_UINT16(1); */
840838
TSQueryquery=PG_GETARG_TSQUERY(2);
841-
842839
/* int32nkeys = PG_GETARG_INT32(3); */
843-
Pointer*extra_data= (Pointer*)PG_GETARG_POINTER(4);
840+
Pointer*extra_data= (Pointer*)PG_GETARG_POINTER(4);
844841
bool*recheck= (bool*)PG_GETARG_POINTER(5);
845842
Datum*addInfo= (Datum*)PG_GETARG_POINTER(8);
846843
bool*addInfoIsNull= (bool*)PG_GETARG_POINTER(9);
@@ -881,12 +878,10 @@ Datum
881878
rum_tsquery_timestamp_consistent(PG_FUNCTION_ARGS)
882879
{
883880
bool*check= (bool*)PG_GETARG_POINTER(0);
884-
885881
/* StrategyNumber strategy = PG_GETARG_UINT16(1); */
886882
TSQueryquery=PG_GETARG_TSQUERY(2);
887-
888883
/* int32nkeys = PG_GETARG_INT32(3); */
889-
Pointer*extra_data= (Pointer*)PG_GETARG_POINTER(4);
884+
Pointer*extra_data= (Pointer*)PG_GETARG_POINTER(4);
890885
bool*recheck= (bool*)PG_GETARG_POINTER(5);
891886
Datum*addInfo= (Datum*)PG_GETARG_POINTER(8);
892887
bool*addInfoIsNull= (bool*)PG_GETARG_POINTER(9);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp