From 1b0f3df0225615c614257c6c4ac06895a05f468f Mon Sep 17 00:00:00 2001
From: Daniel Czerwonk <czerwonk@users.noreply.github.com>
Date: Thu, 31 May 2018 21:44:29 +0200
Subject: [PATCH] Update path_attributes.go

simplification
---
 protocols/bgp/packet/path_attributes.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/protocols/bgp/packet/path_attributes.go b/protocols/bgp/packet/path_attributes.go
index 071a7c55..f238cfd6 100644
--- a/protocols/bgp/packet/path_attributes.go
+++ b/protocols/bgp/packet/path_attributes.go
@@ -261,8 +261,7 @@ func (pa *PathAttribute) decodeCommunities(buf *bytes.Buffer) error {
 			return fmt.Errorf("Unable to read next hop: buf.Read read %d bytes", n)
 		}
 
-		v := fourBytesToUint32(c)
-		coms[i] = v
+		coms[i] = fourBytesToUint32(c)
 	}
 
 	pa.Value = coms
-- 
GitLab