diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-30 13:42:14 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-30 13:42:14 -0300 |
commit | c9d29775195922136c09cc980bb1b7091bf3d859 (patch) | |
tree | 2a7ffae1890975a24c18aa92f6dfe5307051492a /contrib/btree_gist/btree_date.c | |
parent | 4e89c79a52f8a898edd648b56a00f0f4f840cfe7 (diff) |
Clean up newlines following left parentheses
We used to strategically place newlines after some function call left
parentheses to make pgindent move the argument list a few chars to the
left, so that the whole line would fit under 80 chars. However,
pgindent no longer does that, so the newlines just made the code
vertically longer for no reason. Remove those newlines, and reflow some
of those lines for some extra naturality.
Reviewed-by: Michael Paquier, Tom Lane
Discussion: https://postgr.es/m/20200129200401.GA6303@alvherre.pgsql
Diffstat (limited to 'contrib/btree_gist/btree_date.c')
-rw-r--r-- | contrib/btree_gist/btree_date.c | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c index 992ce575073..455a265a497 100644 --- a/contrib/btree_gist/btree_date.c +++ b/contrib/btree_gist/btree_date.c @@ -29,41 +29,42 @@ PG_FUNCTION_INFO_V1(gbt_date_same); static bool gbt_dategt(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_gt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_gt, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } static bool gbt_datege(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_ge, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_ge, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } static bool gbt_dateeq(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_eq, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) + return DatumGetBool(DirectFunctionCall2(date_eq, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b))) ); } static bool gbt_datele(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_le, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_le, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } static bool gbt_datelt(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_lt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_lt, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } @@ -75,9 +76,13 @@ gbt_datekey_cmp(const void *a, const void *b, FmgrInfo *flinfo) dateKEY *ib = (dateKEY *) (((const Nsrt *) b)->t); int res; - res = DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->lower), DateADTGetDatum(ib->lower))); + res = DatumGetInt32(DirectFunctionCall2(date_cmp, + DateADTGetDatum(ia->lower), + DateADTGetDatum(ib->lower))); if (res == 0) - return DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->upper), DateADTGetDatum(ib->upper))); + return DatumGetInt32(DirectFunctionCall2(date_cmp, + DateADTGetDatum(ia->upper), + DateADTGetDatum(ib->upper))); return res; } @@ -162,9 +167,9 @@ gbt_date_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, + fcinfo->flinfo)); } @@ -181,9 +186,8 @@ gbt_date_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -207,15 +211,13 @@ gbt_date_penalty(PG_FUNCTION_ARGS) int32 diff, res; - diff = DatumGetInt32(DirectFunctionCall2( - date_mi, + diff = DatumGetInt32(DirectFunctionCall2(date_mi, DateADTGetDatum(newentry->upper), DateADTGetDatum(origentry->upper))); res = Max(diff, 0); - diff = DatumGetInt32(DirectFunctionCall2( - date_mi, + diff = DatumGetInt32(DirectFunctionCall2(date_mi, DateADTGetDatum(origentry->lower), DateADTGetDatum(newentry->lower))); @@ -225,8 +227,7 @@ gbt_date_penalty(PG_FUNCTION_ARGS) if (res > 0) { - diff = DatumGetInt32(DirectFunctionCall2( - date_mi, + diff = DatumGetInt32(DirectFunctionCall2(date_mi, DateADTGetDatum(origentry->upper), DateADTGetDatum(origentry->lower))); *result += FLT_MIN; @@ -241,11 +242,9 @@ gbt_date_penalty(PG_FUNCTION_ARGS) Datum gbt_date_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum |