We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f77b54b commit c04e76dCopy full SHA for c04e76d
include/libp2p/multi/uvarint.hpp
@@ -67,6 +67,7 @@ namespace libp2p::multi {
67
68
bool operator==(const UVarint& r) const;
69
bool operator!=(const UVarint& r) const;
70
+ bool operator<(const UVarint& r) const;
71
72
/**
73
* @return the number of bytes currently stored in a varint
src/multi/uvarint.cpp
@@ -76,6 +76,10 @@ namespace libp2p::multi {
76
return !(*this == r);
77
}
78
79
+ bool UVarint::operator<(const UVarint &r) const {
80
+ return toUInt64() < r.toUInt64();
81
+ }
82
+
83
size_t UVarint::calculateSize(gsl::span<const uint8_t> varint_bytes) {
84
size_t size = 0;
85
size_t shift = 0;
0 commit comments