mirror of
https://github.com/XTXMarkets/ternfs.git
synced 2026-04-29 14:19:14 -05:00
Remove C++ varint code, we don't use varints anymore
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user