code optimization

This commit is contained in:
Kaili Xu 2021-06-10 19:02:10 +08:00
parent 93993d0796
commit ac38441009
2 changed files with 2 additions and 4 deletions

View File

@ -7502,10 +7502,9 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
uint32_t maxSize = tscGetTableMetaMaxSize(); uint32_t maxSize = tscGetTableMetaMaxSize();
char name[TSDB_TABLE_FNAME_LEN] = {0}; char name[TSDB_TABLE_FNAME_LEN] = {0};
// char buf[80 * 1024] = {0};
assert(maxSize < 80 * TSDB_MAX_COLUMNS); assert(maxSize < 80 * TSDB_MAX_COLUMNS);
if (!pSql->pBuf) { if (!pSql->pBuf) {
if (NULL == (pSql->pBuf = calloc(1, 80 * TSDB_MAX_COLUMNS))) { if (NULL == (pSql->pBuf = tcalloc(1, 80 * TSDB_MAX_COLUMNS))) {
return TSDB_CODE_TSC_OUT_OF_MEMORY; return TSDB_CODE_TSC_OUT_OF_MEMORY;
} }
} }

View File

@ -2509,10 +2509,9 @@ int32_t tscGetTableMetaImpl(SSqlObj* pSql, STableMetaInfo *pTableMetaInfo, bool
taosHashGetClone(tscTableMetaInfo, name, len, NULL, pTableMetaInfo->pTableMeta, -1); taosHashGetClone(tscTableMetaInfo, name, len, NULL, pTableMetaInfo->pTableMeta, -1);
// TODO resize the tableMeta // TODO resize the tableMeta
// char buf[80 * TSDB_MAX_COLUMNS] = {0};
assert(size < 80 * TSDB_MAX_COLUMNS); assert(size < 80 * TSDB_MAX_COLUMNS);
if (!pSql->pBuf) { if (!pSql->pBuf) {
if (NULL == (pSql->pBuf = calloc(1, 80 * TSDB_MAX_COLUMNS))) { if (NULL == (pSql->pBuf = tcalloc(1, 80 * TSDB_MAX_COLUMNS))) {
return TSDB_CODE_TSC_OUT_OF_MEMORY; return TSDB_CODE_TSC_OUT_OF_MEMORY;
} }
} }