diff options
author | Josh Bleecher Snyder <josh@tailscale.com> | 2020-12-15 16:00:52 -0800 |
---|---|---|
committer | Josh Bleecher Snyder <josh@tailscale.com> | 2020-12-16 16:16:26 -0800 |
commit | 7d88fbd2177caccef40ab60c927f9539e723903e (patch) | |
tree | 0a228df9a2e2438388918c766577255496aa6e3c /device/receive.go | |
parent | 15af3e58ce918d4f68f3a85710e7252f5260d741 (diff) | |
download | wireguard-go-7d88fbd2177caccef40ab60c927f9539e723903e.tar.gz wireguard-go-7d88fbd2177caccef40ab60c927f9539e723903e.zip |
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>
Diffstat (limited to 'device/receive.go')
-rw-r--r-- | device/receive.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/device/receive.go b/device/receive.go index 852bd89..aeaae51 100644 --- a/device/receive.go +++ b/device/receive.go @@ -56,26 +56,26 @@ func (elem *QueueInboundElement) IsDropped() bool { return atomic.LoadInt32(&elem.dropped) == AtomicTrue } -func (device *Device) addToInboundAndDecryptionQueues(inboundQueue chan *QueueInboundElement, decryptionQueue chan *QueueInboundElement, element *QueueInboundElement) bool { +func (device *Device) addToInboundAndDecryptionQueues(inboundQueue chan *QueueInboundElement, decryptionQueue chan *QueueInboundElement, elem *QueueInboundElement) bool { select { - case inboundQueue <- element: + case inboundQueue <- elem: select { - case decryptionQueue <- element: + case decryptionQueue <- elem: return true default: - element.Drop() - element.Unlock() + elem.Drop() + elem.Unlock() return false } default: - device.PutInboundElement(element) + device.PutInboundElement(elem) return false } } -func (device *Device) addToHandshakeQueue(queue chan QueueHandshakeElement, element QueueHandshakeElement) bool { +func (device *Device) addToHandshakeQueue(queue chan QueueHandshakeElement, elem QueueHandshakeElement) bool { select { - case queue <- element: + case queue <- elem: return true default: return false |