don't check refcount in packet buffer's destroy function

The function is only called when refcount is zero,
so we don't have to check again.

PiperOrigin-RevId: 438171100
This commit is contained in:
Kevin Krakauer
2022-03-29 17:47:37 -07:00
committed by gVisor bot
parent 007a91a911
commit c2bd153760
+1 -3
View File
@@ -188,9 +188,7 @@ func NewPacketBuffer(opts PacketBufferOptions) *PacketBuffer {
// pool.
func (pk *PacketBuffer) DecRef() {
pk.packetBufferRefs.DecRef(func() {
if pk.packetBufferRefs.refCount == 0 {
pkPool.Put(pk)
}
pkPool.Put(pk)
})
}