refactor: do some internal refactor.

This commit is contained in:
Haojun Liao 2023-01-06 17:44:36 +08:00
parent e73129fda5
commit db48c2350d
1 changed files with 5 additions and 4 deletions

View File

@ -284,9 +284,9 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha
int64_t* p = (int64_t*) output; int64_t* p = (int64_t*) output;
if (selector == 0 || selector == 1) { if (selector == 0 || selector == 1) {
#if 0 #if 1
int32_t batch = elems >> 2; int32_t batch = elems >> 2;
int32_t remainder = elems & 0x3; int32_t remainder = elems & 0x03;
int32_t gBatch = (nelements - count) >> 2; int32_t gBatch = (nelements - count) >> 2;
int32_t minBatch = TMIN(batch, gBatch); int32_t minBatch = TMIN(batch, gBatch);
@ -301,15 +301,16 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha
int32_t gRemainder = nelements - count; int32_t gRemainder = nelements - count;
int32_t minRemain = TMIN(remainder, gRemainder); int32_t minRemain = TMIN(remainder, gRemainder);
for (int32_t i = 0; i < minRemain; i++) { for (int32_t i = 0; i < minRemain; ++i) {
p[_pos++] = prev_value; p[_pos++] = prev_value;
} }
count += minRemain; count += minRemain;
#endif #else
for (int32_t i = 0; i < elems && count < nelements; i++, count++) { for (int32_t i = 0; i < elems && count < nelements; i++, count++) {
p[_pos++] = prev_value; p[_pos++] = prev_value;
} }
#endif
} else { } else {
int32_t batch = elems >> 2; int32_t batch = elems >> 2;
int32_t remain = elems & 0x03; int32_t remain = elems & 0x03;