Unused variable in hashpage.c

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Unused variable in hashpage.c
Date: 2015-04-02 23:46:12
Message-ID: 551DD4C4.70107@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

my compiler complains about unused variable nblkno in _hash_splitbucket
in no-assert build. It looks like relic of commit ed9cc2b5d which
removed the only use of that variable besides the Assert.

Looking at the code:
nblkno = start_nblkno;
Assert(nblkno == BufferGetBlockNumber(nbuf));

I was originally thinking of simply changing the Assert to use
start_nblkno but then I noticed that the start_nblkno is actually not
used anywhere in the function either (it's one of input parameters). And
given that the only caller of that function is getting the variable it
sends as nbuf to that function via start_nblkno, I think the Assert is
somewhat pointless there anyway.

So best way to solve this seems to be removing the start_nblkno from the
_hash_splitbucket altogether. Attached patch does just that.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
hashpage-remove-unused-var.diff text/x-diff 1.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-04-03 02:04:55 Re: Table-level log_autovacuum_min_duration
Previous Message Peter Geoghegan 2015-04-02 23:08:13 Re: Re: Abbreviated keys for Datum tuplesort