Small patch: fix double variable initializations in policy.c

From: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Small patch: fix double variable initializations in policy.c
Date: 2016-03-16 08:20:19
Message-ID: 20160316112019.64057481@fujitsu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I discovered a pretty weird code.

policy.c:1083

```
char *qual_value;
ParseState *qual_pstate = make_parsestate(NULL);

/* parsestate is built just to build the range table */
qual_pstate = make_parsestate(NULL);
```

policy.c:1125

```
char *with_check_value;
ParseState *with_check_pstate = make_parsestate(NULL);

/* parsestate is built just to build the range table */
with_check_pstate = make_parsestate(NULL);
```

I'm quite sure that there is no need to initialize these variables
twice. First patch fixes this. Also I discovered that policy.c is not
properly pgindent'ed. Second patch fixes this too.

Naturally I checked that after applying these patches PostgreSQL still
compiles and pass all regression tests.

--
Best regards,
Aleksander Alekseev
http://eax.me/

Attachment Content-Type Size
policy-c-fix-step1.diff text/x-patch 1.0 KB
policy-c-fix-step2.diff text/x-patch 4.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2016-03-16 08:31:11 Re: multivariate statistics v14
Previous Message Julien Rouhaud 2016-03-16 08:15:47 Re: Choosing parallel_degree