mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-29 19:11:54 +08:00
device: always name *Queue*Element variables elem
They're called elem in most places. Rename a few local variables to make it consistent. This makes it easier to grep the code for things like elem.Drop. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
committed by
Jason A. Donenfeld
parent
2832e96339
commit
c8faa34cde
@@ -64,12 +64,12 @@ func (device *Device) GetInboundElement() *QueueInboundElement {
|
||||
}
|
||||
}
|
||||
|
||||
func (device *Device) PutInboundElement(msg *QueueInboundElement) {
|
||||
msg.clearPointers()
|
||||
func (device *Device) PutInboundElement(elem *QueueInboundElement) {
|
||||
elem.clearPointers()
|
||||
if PreallocatedBuffersPerPool == 0 {
|
||||
device.pool.inboundElementPool.Put(msg)
|
||||
device.pool.inboundElementPool.Put(elem)
|
||||
} else {
|
||||
device.pool.inboundElementReuseChan <- msg
|
||||
device.pool.inboundElementReuseChan <- elem
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,11 +81,11 @@ func (device *Device) GetOutboundElement() *QueueOutboundElement {
|
||||
}
|
||||
}
|
||||
|
||||
func (device *Device) PutOutboundElement(msg *QueueOutboundElement) {
|
||||
msg.clearPointers()
|
||||
func (device *Device) PutOutboundElement(elem *QueueOutboundElement) {
|
||||
elem.clearPointers()
|
||||
if PreallocatedBuffersPerPool == 0 {
|
||||
device.pool.outboundElementPool.Put(msg)
|
||||
device.pool.outboundElementPool.Put(elem)
|
||||
} else {
|
||||
device.pool.outboundElementReuseChan <- msg
|
||||
device.pool.outboundElementReuseChan <- elem
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user