refactor: do some internal refactor.
This commit is contained in:
parent
e65927bc5b
commit
cdeca85e31
|
@ -189,6 +189,7 @@ bool tLDataIterNextRow(SLDataIter *pIter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t iBlockL = pIter->iBlockL;
|
int32_t iBlockL = pIter->iBlockL;
|
||||||
|
|
||||||
if (pIter->bData.nRow == 0 && pIter->pBlockL != NULL) { // current block not loaded yet
|
if (pIter->bData.nRow == 0 && pIter->pBlockL != NULL) { // current block not loaded yet
|
||||||
code = tsdbReadLastBlockEx(pIter->pReader, pIter->iLast, pIter->pBlockL, &pIter->bData);
|
code = tsdbReadLastBlockEx(pIter->pReader, pIter->iLast, pIter->pBlockL, &pIter->bData);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
@ -199,6 +200,8 @@ bool tLDataIterNextRow(SLDataIter *pIter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pIter->iRow += step;
|
pIter->iRow += step;
|
||||||
|
|
||||||
|
while(1) {
|
||||||
findNextValidRow(pIter);
|
findNextValidRow(pIter);
|
||||||
|
|
||||||
if (pIter->iRow >= pIter->bData.nRow || pIter->iRow < 0) {
|
if (pIter->iRow >= pIter->bData.nRow || pIter->iRow < 0) {
|
||||||
|
@ -206,23 +209,16 @@ bool tLDataIterNextRow(SLDataIter *pIter) {
|
||||||
if (pIter->pBlockL == NULL) { // no more data
|
if (pIter->pBlockL == NULL) { // no more data
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iBlockL != pIter->iBlockL) {
|
if (iBlockL != pIter->iBlockL) {
|
||||||
if (pIter->pBlockL) {
|
|
||||||
code = tsdbReadLastBlockEx(pIter->pReader, pIter->iLast, pIter->pBlockL, &pIter->bData);
|
code = tsdbReadLastBlockEx(pIter->pReader, pIter->iLast, pIter->pBlockL, &pIter->bData);
|
||||||
if (code) {
|
if (code) {
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
pIter->iRow = pIter->backward ? (pIter->bData.nRow - 1) : 0;
|
pIter->iRow = pIter->backward ? (pIter->bData.nRow - 1) : 0;
|
||||||
findNextValidRow(pIter);
|
|
||||||
if (pIter->iRow >= pIter->bData.nRow || pIter->iRow < 0) {
|
|
||||||
// todo try next block
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// no more data
|
|
||||||
goto _exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,10 +228,10 @@ bool tLDataIterNextRow(SLDataIter *pIter) {
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
return false;
|
terrno = code;
|
||||||
} else {
|
|
||||||
return pIter->pBlockL != NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return (code == TSDB_CODE_SUCCESS) && (pIter->pBlockL != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SRowInfo *tLDataIterGet(SLDataIter *pIter) {
|
SRowInfo *tLDataIterGet(SLDataIter *pIter) {
|
||||||
|
|
Loading…
Reference in New Issue