MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / get_rounds

Function get_rounds

extra/yassl/src/yassl_imp.cpp:1096–1119  ·  view source on GitHub ↗

get number of compression rounds

Source from the content-addressed store, hash-verified

1094
1095// get number of compression rounds
1096static inline int get_rounds(int pLen, int padLen, int t)
1097{
1098 int roundL1 = 1; // round ups
1099 int roundL2 = 1;
1100
1101 int L1 = COMPRESS_CONSTANT + pLen - t;
1102 int L2 = COMPRESS_CONSTANT + pLen - padLen - 1 - t;
1103
1104 L1 -= COMPRESS_UPPER;
1105 L2 -= COMPRESS_UPPER;
1106
1107 if ( (L1 % COMPRESS_LOWER) == 0)
1108 roundL1 = 0;
1109 if ( (L2 % COMPRESS_LOWER) == 0)
1110 roundL2 = 0;
1111
1112 L1 /= COMPRESS_LOWER;
1113 L2 /= COMPRESS_LOWER;
1114
1115 L1 += roundL1;
1116 L2 += roundL2;
1117
1118 return L1 - L2;
1119}
1120
1121
1122// do compression rounds on dummy data

Callers 1

timing_verifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected