Skip to content

Commit 6bd323c

Browse files
committed
Remove un-needed braces around single statements.
1 parent 27db9ec commit 6bd323c

File tree

224 files changed

+220
-2503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+220
-2503
lines changed

contrib/array/array_iterator.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,38 +104,26 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
104104
{
105105
result = (int) (*proc_fn) (p, value);
106106
if (typlen > 0)
107-
{
108107
p += typlen;
109-
}
110108
else
111-
{
112109
p += INTALIGN(*(int32 *) p);
113-
}
114110
}
115111
if (result)
116112
{
117113
if (!and)
118-
{
119114
return (1);
120-
}
121115
}
122116
else
123117
{
124118
if (and)
125-
{
126119
return (0);
127-
}
128120
}
129121
}
130122

131123
if (and && result)
132-
{
133124
return (1);
134-
}
135125
else
136-
{
137126
return (0);
138-
}
139127
}
140128

141129
/*

contrib/datetime/datetime_functions.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,9 @@ hhmm_out(TimeADT *time)
9797
tm->tm_sec = (((int) *time) % 60);
9898

9999
if (tm->tm_sec == 0)
100-
{
101100
sprintf(buf, "%02d:%02d", tm->tm_hour, tm->tm_min);
102-
}
103101
else
104-
{
105102
sprintf(buf, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
106-
}
107103

108104
result = palloc(strlen(buf) + 1);
109105

contrib/string/string_io.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ string_output(char *data, int size)
6666
}
6767

6868
if (size < 0)
69-
{
7069
size = strlen(data);
71-
}
7270

7371
/* adjust string length for escapes */
7472
len = size;
@@ -90,9 +88,7 @@ string_output(char *data, int size)
9088
break;
9189
default:
9290
if (NOTPRINTABLE(*p))
93-
{
9491
len += 3;
95-
}
9692
}
9793
}
9894
len++;
@@ -147,9 +143,7 @@ string_output(char *data, int size)
147143
r += 3;
148144
}
149145
else
150-
{
151146
*r++ = c;
152-
}
153147
}
154148
}
155149
*r = '\0';
@@ -192,9 +186,7 @@ string_input(char *str, int size, int hdrsize, int *rtn_size)
192186
int len;
193187

194188
if ((str == NULL) || (hdrsize < 0))
195-
{
196189
return (char *) NULL;
197-
}
198190

199191
/* Compute result size */
200192
len = strlen(str);
@@ -223,22 +215,16 @@ string_input(char *str, int size, int hdrsize, int *rtn_size)
223215

224216
/* result has variable length */
225217
if (size == 0)
226-
{
227218
size = len + 1;
228-
}
229219
else
230220
/* result has variable length with maximum size */
231221
if (size < 0)
232-
{
233222
size = MIN(len, -size) + 1;
234-
}
235223

236224
result = (char *) palloc(hdrsize + size);
237225
memset(result, 0, hdrsize + size);
238226
if (rtn_size)
239-
{
240227
*rtn_size = size;
241-
}
242228

243229
r = result + hdrsize;
244230
for (p = str; *p;)
@@ -262,13 +248,9 @@ string_input(char *str, int size, int hdrsize, int *rtn_size)
262248
case '7':
263249
c = VALUE(c);
264250
if (isdigit(*p))
265-
{
266251
c = (c << 3) + VALUE(*p++);
267-
}
268252
if (isdigit(*p))
269-
{
270253
c = (c << 3) + VALUE(*p++);
271-
}
272254
*r++ = c;
273255
break;
274256
case 'b':
@@ -294,9 +276,7 @@ string_input(char *str, int size, int hdrsize, int *rtn_size)
294276
}
295277
}
296278
else
297-
{
298279
*r++ = c;
299-
}
300280
}
301281

302282
return ((char *) result);
@@ -380,9 +360,7 @@ c_textin(char *str)
380360
int len;
381361

382362
if (str == NULL)
383-
{
384363
return ((struct varlena *) NULL);
385-
}
386364

387365
result = (struct varlena *) string_input(str, 0, VARHDRSZ, &len);
388366
VARSIZE(result) = len;

src/backend/access/common/heaptuple.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.37 1998/02/26 04:29:15 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.38 1998/06/15 19:27:44 momjian Exp $
1212
*
1313
* NOTES
1414
* The old interface functions have been converted to macros
@@ -143,9 +143,7 @@ DataFill(char *data,
143143
if (bit != NULL)
144144
{
145145
if (bitmask != CSIGNBIT)
146-
{
147146
bitmask <<= 1;
148-
}
149147
else
150148
{
151149
bitP += 1;
@@ -167,13 +165,9 @@ DataFill(char *data,
167165
case -1:
168166
*infomask |= HEAP_HASVARLENA;
169167
if (att[i]->attalign == 'd')
170-
{
171168
data = (char *) DOUBLEALIGN(data);
172-
}
173169
else
174-
{
175170
data = (char *) INTALIGN(data);
176-
}
177171
data_length = VARSIZE(DatumGetPointer(value[i]));
178172
memmove(data, DatumGetPointer(value[i]), data_length);
179173
data += data_length;
@@ -239,9 +233,7 @@ heap_attisnull(HeapTuple tup, int attnum)
239233
return (0);
240234

241235
if (attnum > 0)
242-
{
243236
return (att_isnull(attnum - 1, tup->t_bits));
244-
}
245237
else
246238
switch (attnum)
247239
{
@@ -513,9 +505,7 @@ nocachegetattr(HeapTuple tup,
513505
tp + att[attnum]->attcacheoff);
514506
}
515507
else if (attnum == 0)
516-
{
517508
return ((Datum) fetchatt(&(att[0]), (char *) tp));
518-
}
519509
else if (!HeapTupleAllFixed(tup))
520510
{
521511
int j = 0;

src/backend/access/common/indextuple.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.28 1998/02/26 04:29:18 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.29 1998/06/15 19:27:44 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -178,9 +178,7 @@ nocache_index_getattr(IndexTuple tup,
178178
/* first attribute is always at position zero */
179179

180180
if (attnum == 1)
181-
{
182181
return (Datum) fetchatt(&(att[0]), (char *) tup + data_off);
183-
}
184182
if (att[attnum]->attcacheoff != -1)
185183
{
186184
return (Datum) fetchatt(&(att[attnum]),
@@ -260,9 +258,7 @@ nocache_index_getattr(IndexTuple tup,
260258
tp + att[attnum]->attcacheoff);
261259
}
262260
else if (attnum == 0)
263-
{
264261
return ((Datum) fetchatt(&(att[0]), (char *) tp));
265-
}
266262
else if (!IndexTupleAllFixed(tup))
267263
{
268264
int j = 0;
@@ -482,9 +478,7 @@ CopyIndexTuple(IndexTuple source, IndexTuple *target)
482478

483479
size = IndexTupleSize(source);
484480
if (*target == NULL)
485-
{
486481
*target = (IndexTuple) palloc(size);
487-
}
488482

489483
ret = *target;
490484
memmove((char *) ret, (char *) source, size);

src/backend/access/common/indexvalid.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.18 1998/01/31 05:54:54 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.19 1998/06/15 19:27:45 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -61,9 +61,7 @@ index_keytest(IndexTuple tuple,
6161
}
6262

6363
if (key[0].sk_flags & SK_ISNULL)
64-
{
6564
return (false);
66-
}
6765

6866
if (key[0].sk_flags & SK_COMMUTE)
6967
{
@@ -79,9 +77,7 @@ index_keytest(IndexTuple tuple,
7977
}
8078

8179
if (!test == !(key[0].sk_flags & SK_NEGATE))
82-
{
8380
return (false);
84-
}
8581

8682
scanKeySize -= 1;
8783
key++;

src/backend/access/common/tupdesc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.39 1998/04/26 04:05:02 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.40 1998/06/15 19:27:45 momjian Exp $
1111
*
1212
* NOTES
1313
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -508,9 +508,7 @@ BuildDescForRelation(List *schema, char *relname)
508508
* ----------------
509509
*/
510510
if (!strcmp(typename, relname))
511-
{
512511
TupleDescMakeSelfReference(desc, attnum, relname);
513-
}
514512
else
515513
elog(ERROR, "DefineRelation: no such type %s",
516514
typename);

src/backend/access/gist/gist.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,7 @@ gistAdjustKeys(Relation r,
632632
pfree(datum);
633633
}
634634
else
635-
{
636635
ReleaseBuffer(b);
637-
}
638636
pfree(evec);
639637
}
640638

@@ -834,9 +832,7 @@ gistSplit(Relation r,
834832
}
835833

836834
if ((bufblock = BufferGetBlockNumber(buffer)) != GISTP_ROOT)
837-
{
838835
PageRestoreTempPage(left, p);
839-
}
840836
WriteBuffer(leftbuf);
841837
WriteBuffer(rightbuf);
842838

0 commit comments

Comments
 (0)