Remove C++ varint code, we don't use varints anymore

This commit is contained in:
Francesco Mazzoli
2023-06-27 13:55:00 +00:00
parent a425dd570d
commit f0add4d926
2 changed files with 0 additions and 33 deletions
-20
View File
@@ -286,14 +286,6 @@ struct BincodeBuf {
cursor += sizeof(A);
}
void packVarU61(uint64_t x) {
uint64_t neededBytes = varU61Size(x);
ensureSizeOrPanic(neededBytes);
x = (x << 3) | (neededBytes-1);
memcpy(cursor, &x, neededBytes);
cursor += neededBytes;
}
template<size_t SZ>
void packFixedBytes(const BincodeFixedBytes<SZ>& x) {
ensureSizeOrPanic(SZ);
@@ -330,18 +322,6 @@ struct BincodeBuf {
return x;
}
uint64_t unpackVarU61() {
uint64_t head = unpackScalar<uint8_t>();
uint64_t bytes = head & (8 - 1);
if (unlikely(remaining() < bytes)) {
throw BINCODE_EXCEPTION("not enough bytes to unpack var u61 (need %s, got %s)", bytes, remaining());
}
uint64_t tail = 0;
memcpy(&tail, cursor, bytes);
cursor += bytes;
return (head >> 3) | (tail << 5);
}
template<size_t SZ>
void unpackFixedBytes(BincodeFixedBytes<SZ>& x) {
if (unlikely(remaining() < SZ)) {