forked from quic-go/quic-go
make sure that VarIntLen can be inlined
This commit is contained in:
@@ -97,5 +97,10 @@ func VarIntLen(i uint64) protocol.ByteCount {
|
||||
if i <= maxVarInt8 {
|
||||
return 8
|
||||
}
|
||||
panic(fmt.Sprintf("%#x doesn't fit into 62 bits", i))
|
||||
// Don't use a fmt.Sprintf here to format the error message.
|
||||
// The function would then exceed the inlining budget.
|
||||
panic(struct {
|
||||
message string
|
||||
num uint64
|
||||
}{"value doesn't fit into 62 bits: ", i})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user