Skip to content

Commit 9cb4c68

Browse files
committed
serialize: make GetSizeOfCompactSize constexpr
1 parent 892436c commit 9cb4c68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/serialize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ template <typename Stream> inline void Unserialize(Stream& s, bool& a) { uint8_t
316316
* size <= UINT_MAX -- 5 bytes (254 + 4 bytes)
317317
* size > UINT_MAX -- 9 bytes (255 + 8 bytes)
318318
*/
319-
inline unsigned int GetSizeOfCompactSize(uint64_t nSize)
319+
constexpr inline unsigned int GetSizeOfCompactSize(uint64_t nSize)
320320
{
321321
if (nSize < 253) return sizeof(unsigned char);
322322
else if (nSize <= std::numeric_limits<uint16_t>::max()) return sizeof(unsigned char) + sizeof(uint16_t);

0 commit comments

Comments
 (0)