Make code logic clear for coverity test

Homogenizes condition for using correct scan method and resolving
coverity test complain.
This commit is contained in:
Ruslan Fomkin 2020-04-07 10:24:53 +02:00 committed by Erik Nordström
parent dd753f2a3c
commit 5df7946e88

View File

@ -729,6 +729,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, bool verbose,
CHECK_FOR_INTERRUPTS(); CHECK_FOR_INTERRUPTS();
Assert((heapScan != NULL && indexScan == NULL) || (indexScan != NULL && heapScan == NULL));
if (indexScan != NULL) if (indexScan != NULL)
{ {
tuple = index_getnext(indexScan, ForwardScanDirection); tuple = index_getnext(indexScan, ForwardScanDirection);
@ -741,7 +742,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, bool verbose,
buf = indexScan->xs_cbuf; buf = indexScan->xs_cbuf;
} }
else if (heapScan != NULL)
{ {
tuple = heap_getnext(heapScan, ForwardScanDirection); tuple = heap_getnext(heapScan, ForwardScanDirection);
if (tuple == NULL) if (tuple == NULL)