From 4f9885a8594733c1ab1ab65b9129d39e1052a727 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 16 Nov 2022 10:52:45 +0800 Subject: [PATCH] refact more code --- include/common/tdataformat.h | 10 ---------- source/common/src/tdataformat.c | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/common/tdataformat.h b/include/common/tdataformat.h index 5d0b012fca..1f53e731a5 100644 --- a/include/common/tdataformat.h +++ b/include/common/tdataformat.h @@ -74,7 +74,6 @@ int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t nCols, STSchema * void tTSchemaDestroy(STSchema *pTSchema); // SValue ================================ -static FORCE_INLINE int32_t tGetValue(uint8_t *p, SValue *pValue, int8_t type); // SColVal ================================ #define CV_FLAG_VALUE ((int8_t)0x0) @@ -280,15 +279,6 @@ void tdResetTSchemaBuilder(STSchemaBuilder *pBuilder, schema_ver_t version) int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t flags, col_id_t colId, col_bytes_t bytes); STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder); -static FORCE_INLINE int32_t tGetValue(uint8_t *p, SValue *pValue, int8_t type) { - if (IS_VAR_DATA_TYPE(type)) { - return tGetBinary(p, &pValue->pData, pValue ? &pValue->nData : NULL); - } else { - memcpy(&pValue->val, p, tDataTypes[type].bytes); - return tDataTypes[type].bytes; - } -} - #endif #ifdef __cplusplus diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index 73b887342c..b3d22d7ada 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -1496,7 +1496,7 @@ static FORCE_INLINE void tColDataGetValue4(SColData *pColData, int32_t iVal, SCo } value.pData = pColData->pData + pColData->aOffset[iVal]; } else { - tGetValue(pColData->pData + tDataTypes[pColData->type].bytes * iVal, &value, pColData->type); + memcpy(&value.val, pColData->pData + tDataTypes[pColData->type].bytes * iVal, tDataTypes[pColData->type].bytes); } *pColVal = COL_VAL_VALUE(pColData->cid, pColData->type, value); }