From e200a7af6d7dc70e7b2fb41ac7ccd8a0250e7489 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 3 Aug 2021 17:52:39 +0800 Subject: [PATCH] code optimization --- src/client/inc/tsclient.h | 6 +----- src/client/src/tscParseInsert.c | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index cb67fa336b..07acb20cbe 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -43,8 +43,6 @@ struct SSqlInfo; typedef void (*__async_cb_func_t)(void *param, TAOS_RES *tres, int32_t numOfRows); -#define __5221_BRANCH__ - typedef struct SNewVgroupInfo { int32_t vgId; int8_t inUse; @@ -519,10 +517,8 @@ int16_t getNewResColId(SSqlCmd* pCmd); int32_t schemaIdxCompar(const void *lhs, const void *rhs); int32_t boundIdxCompar(const void *lhs, const void *rhs); static FORCE_INLINE int32_t getExtendedRowSize(STableDataBlocks *pBlock) { -#ifdef __5221_BRANCH__ ASSERT(pBlock->rowSize == pBlock->pTableMeta->tableInfo.rowSize); -#endif - return pBlock->pTableMeta->tableInfo.rowSize + TD_MEM_ROW_DATA_HEAD_SIZE + pBlock->boundColumnInfo.extendedVarLen; + return pBlock->rowSize + TD_MEM_ROW_DATA_HEAD_SIZE + pBlock->boundColumnInfo.extendedVarLen; } static FORCE_INLINE void checkAndConvertMemRow(SMemRow row, int32_t dataLen, int32_t kvLen) { diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 9cc2eef662..6da26577db 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -43,9 +43,7 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat char *str, char **end); int initMemRowBuilder(SMemRowBuilder *pBuilder, uint32_t nRows, uint32_t nCols, uint32_t nBoundCols, int32_t allNullLen) { -#ifdef __5221_BRANCH__ ASSERT(nRows >= 0 && nCols > 0 && (nBoundCols <= nCols)); -#endif if (nRows > 0) { // already init(bind multiple rows by single column) if (pBuilder->compareStat == ROW_COMPARE_NEED && (pBuilder->rowInfo != NULL)) { @@ -96,7 +94,6 @@ int initMemRowBuilder(SMemRowBuilder *pBuilder, uint32_t nRows, uint3 return TSDB_CODE_SUCCESS; } - int tsParseTime(SStrToken *pToken, int64_t *time, char **next, char *error, int16_t timePrec) { int32_t index = 0; SStrToken sToken; -- GitLab