提交 207b1217 编写于 作者: Z zhihaop

feat: use taosArrayGetP instead of taosArrayGet

上级 c88b3436
...@@ -251,8 +251,8 @@ _error: ...@@ -251,8 +251,8 @@ _error:
tscError("send async batch sql obj failed, reason: %s", tstrerror(code)); tscError("send async batch sql obj failed, reason: %s", tstrerror(code));
// handling the failures. // handling the failures.
for (int i = 0; i < taosArrayGetSize(statements); ++i) { for (size_t i = 0; i < taosArrayGetSize(statements); ++i) {
SSqlObj* item = *((SSqlObj**)taosArrayGet(statements, i)); SSqlObj* item = taosArrayGetP(statements, i);
tscReturnsError(item, code); tscReturnsError(item, code);
} }
} }
......
...@@ -2316,7 +2316,7 @@ static size_t writeSSubmitBlkBuilder(SSubmitBlkBuilder* builder, SSubmitBlk* tar ...@@ -2316,7 +2316,7 @@ static size_t writeSSubmitBlkBuilder(SSubmitBlkBuilder* builder, SSubmitBlk* tar
uint32_t dataLen = 0; uint32_t dataLen = 0;
taosArraySort(builder->rows, compareSMemRow); taosArraySort(builder->rows, compareSMemRow);
for (int i = 0; i < taosArrayGetSize(builder->rows); ++i) { for (int i = 0; i < taosArrayGetSize(builder->rows); ++i) {
char* pRow = *(char**) (taosArrayGet(builder->rows, i)); char* pRow = taosArrayGetP(builder->rows, i);
memcpy(POINTER_SHIFT(target->data, dataLen), pRow, memRowTLen(pRow)); memcpy(POINTER_SHIFT(target->data, dataLen), pRow, memRowTLen(pRow));
dataLen += memRowTLen(pRow); dataLen += memRowTLen(pRow);
} }
...@@ -2920,9 +2920,11 @@ int32_t tscMergeTableDataBlocks(SSqlObj *pSql, SInsertStatementParam *pInsertPar ...@@ -2920,9 +2920,11 @@ int32_t tscMergeTableDataBlocks(SSqlObj *pSql, SInsertStatementParam *pInsertPar
initialSize = initialSize > 128 ? 128 : initialSize; initialSize = initialSize > 128 ? 128 : initialSize;
void* pVnodeDataBlockHashList = taosHashInit(initialSize, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, false); void* pVnodeDataBlockHashList = taosHashInit(initialSize, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, false);
SArray* pTableDataBlockList = taosArrayInit(taosHashGetSize(pInsertParam->pTableBlockHashList), POINTER_BYTES);
SArray* pVnodeDataBlockList = taosArrayInit(8, POINTER_BYTES); SArray* pVnodeDataBlockList = taosArrayInit(8, POINTER_BYTES);
// speed up hash iteration.
SArray* pTableDataBlockList = taosArrayInit(taosHashGetSize(pInsertParam->pTableBlockHashList), POINTER_BYTES);
STableDataBlocks** p = taosHashIterate(pInsertParam->pTableBlockHashList, NULL); STableDataBlocks** p = taosHashIterate(pInsertParam->pTableBlockHashList, NULL);
STableDataBlocks* pOneTableBlock = *p; STableDataBlocks* pOneTableBlock = *p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册