Unused variable in hashpage.c

Поиск
Список
Период
Сортировка
Искать

Unused variable in hashpage.c

От:
Petr Jelinek <petr@2ndquadrant.com>
Дата:
Вложения:
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

Re: Unused variable in hashpage.c

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Petr Jelinek  writes:
> 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.

Fixed, thanks!
		regards, tom lane


FAQ