remove some allocations

ref #129
This commit is contained in:
Lucas Clemente
2016-05-24 15:22:56 +02:00
parent 6c2932a872
commit 55fe1390b3
3 changed files with 10 additions and 1 deletions

View File

@@ -545,6 +545,10 @@ func (s *Session) sendConnectionClose(quicErr *qerr.QuicError) error {
}
func (s *Session) logPacket(packet *packedPacket) {
if !utils.Debug() {
// We don't need to allocate the slices for calling the format functions
return
}
utils.Debugf("-> Sending packet 0x%x (%d bytes)", packet.number, len(packet.raw))
for _, frame := range packet.frames {
if streamFrame, isStreamFrame := frame.(*frames.StreamFrame); isStreamFrame {