提交 e73b4a68 编写于 作者: H Hongze Cheng

refact some code

上级 4c847cde
...@@ -84,31 +84,28 @@ void tLDataIterNextBlock(SLDataIter *pIter) { ...@@ -84,31 +84,28 @@ void tLDataIterNextBlock(SLDataIter *pIter) {
int32_t tLDataIterNextRow(SLDataIter *pIter) { int32_t tLDataIterNextRow(SLDataIter *pIter) {
int32_t code = 0; int32_t code = 0;
int32_t iBlockL = pIter->iBlockL;
if (pIter->backward) { if (pIter->backward) {
pIter->iRow--; pIter->iRow--;
if (pIter->iRow < 0) { if (pIter->iRow < 0) {
pIter->iBlockL--; tLDataIterNextBlock(pIter);
if (pIter->iBlockL >= 0) {
code = tsdbReadLastBlockEx(pIter->pReader, pIter->iLast, taosArrayGet(pIter->aBlockL, pIter->iBlockL),
&pIter->bData);
if (code) goto _exit;
} else {
// TODO: no more data here
}
} }
} else { } else {
pIter->iRow++; pIter->iRow++;
if (pIter->iRow >= pIter->bData.nRow) { if (pIter->iRow >= pIter->bData.nRow) {
pIter->iBlockL++; pIter->iBlockL++;
if (pIter->iBlockL < taosArrayGetSize(pIter->aBlockL)) { tLDataIterNextBlock(pIter);
code = tsdbReadLastBlockEx(pIter->pReader, pIter->iLast, taosArrayGet(pIter->aBlockL, pIter->iBlockL), }
&pIter->bData); }
if (code) goto _exit;
} else { if (iBlockL != pIter->iBlockL) {
// TODO: not more data if (pIter->pBlockL) {
goto _exit; code = tsdbReadLastBlockEx(pIter->pReader, pIter->iLast, pIter->pBlockL, &pIter->bData);
} if (code) goto _exit;
pIter->iRow = 0;
} else {
// no more data
goto _exit;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册