Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit 9bd8aa8

Browse files
committed
Implicit varint length
1 parent fdc31a5 commit 9bd8aa8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

varint.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ size_t bbp_varint_size(uint64_t n) {
7070
if (n < BBP_VARINT16) {
7171
return 1;
7272
} else if (n <= UINT16_MAX) {
73-
return 3;
73+
return 1 + sizeof(uint16_t);
7474
} else if (n <= UINT32_MAX) {
75-
return 5;
75+
return 1 + sizeof(uint32_t);
7676
} else {
77-
return 9;
77+
return 1 + sizeof(uint64_t);
7878
}
7979
}
8080

0 commit comments

Comments
 (0)