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/send.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 '')
-rw-r--r-- | device/send.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/device/send.go b/device/send.go index 1f71f79..6b21708 100644 --- a/device/send.go +++ b/device/send.go @@ -81,10 +81,10 @@ func (elem *QueueOutboundElement) IsDropped() bool { return atomic.LoadInt32(&elem.dropped) == AtomicTrue } -func addToNonceQueue(queue chan *QueueOutboundElement, element *QueueOutboundElement, device *Device) { +func addToNonceQueue(queue chan *QueueOutboundElement, elem *QueueOutboundElement, device *Device) { for { select { - case queue <- element: + case queue <- elem: return default: select { @@ -97,20 +97,20 @@ func addToNonceQueue(queue chan *QueueOutboundElement, element *QueueOutboundEle } } -func addToOutboundAndEncryptionQueues(outboundQueue chan *QueueOutboundElement, encryptionQueue chan *QueueOutboundElement, element *QueueOutboundElement) { +func addToOutboundAndEncryptionQueues(outboundQueue chan *QueueOutboundElement, encryptionQueue chan *QueueOutboundElement, elem *QueueOutboundElement) { select { - case outboundQueue <- element: + case outboundQueue <- elem: select { - case encryptionQueue <- element: + case encryptionQueue <- elem: return default: - element.Drop() - element.peer.device.PutMessageBuffer(element.buffer) - element.Unlock() + elem.Drop() + elem.peer.device.PutMessageBuffer(elem.buffer) + elem.Unlock() } default: - element.peer.device.PutMessageBuffer(element.buffer) - element.peer.device.PutOutboundElement(element) + elem.peer.device.PutMessageBuffer(elem.buffer) + elem.peer.device.PutOutboundElement(elem) } } |