Skip to content

Commit a04ae0d

Browse files
removed CalcTotalLength function (#2112)
1 parent 7d00ca9 commit a04ae0d

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/codec/codec.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -193,27 +193,6 @@ class RowView {
193193

194194
namespace v1 {
195195

196-
static constexpr uint8_t VERSION_LENGTH = 2;
197-
static constexpr uint8_t SIZE_LENGTH = 4;
198-
// calc the total row size with primary_size, str field count and str_size
199-
inline uint32_t CalcTotalLength(uint32_t primary_size, uint32_t str_field_cnt, uint32_t str_size,
200-
uint32_t* str_addr_space) {
201-
uint32_t total_size = primary_size + str_size;
202-
if (total_size + str_field_cnt <= UINT8_MAX) {
203-
*str_addr_space = 1;
204-
return total_size + str_field_cnt;
205-
} else if (total_size + str_field_cnt * 2 <= UINT16_MAX) {
206-
*str_addr_space = 2;
207-
return total_size + str_field_cnt * 2;
208-
} else if (total_size + str_field_cnt * 3 <= 1 << 24) {
209-
*str_addr_space = 3;
210-
return total_size + str_field_cnt * 3;
211-
} else {
212-
*str_addr_space = 4;
213-
return total_size + str_field_cnt * 4;
214-
}
215-
}
216-
217196
inline int8_t GetAddrSpace(uint32_t size) {
218197
if (size <= UINT8_MAX) {
219198
return 1;

0 commit comments

Comments
 (0)