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

fix interpolation corner case

上级 c4f41c6d
......@@ -1105,8 +1105,13 @@ void tBlockDataGetColData(SBlockData *pBlockData, int16_t cid, SColData **ppColD
int32_t ridx = pBlockData->nColData - 1;
while (lidx <= ridx) {
int32_t midx = lidx + (ridx - lidx) * (cid - pBlockData->aColData[lidx].cid) /
(pBlockData->aColData[ridx].cid - pBlockData->aColData[lidx].cid);
int32_t midx;
if (lidx == ridx) {
midx = lidx;
} else {
midx = lidx + (ridx - lidx) * (cid - pBlockData->aColData[lidx].cid) /
(pBlockData->aColData[ridx].cid - pBlockData->aColData[lidx].cid);
}
SColData *pColData = tBlockDataGetColDataByIdx(pBlockData, midx);
int32_t c = (pColData->cid == cid) ? 0 : ((pColData->cid > cid) ? 1 : -1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册