bgpd: optimize loops on [e]community_hash_make()

  This change reduces loop count. Less jumps.

* bgp_community.c: One loop per community.
* bgp_ecommunity.c: One loop per ecommunity.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index 2ba45f6..fc1bef8 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -394,16 +394,19 @@
 unsigned int
 community_hash_make (struct community *com)
 {
+  unsigned char *pnt = (unsigned char *)com->val;
+  int size = com->size * 4;
+  unsigned int key = 0;
   int c;
-  unsigned int key;
-  unsigned char *pnt;
 
-  key = 0;
-  pnt = (unsigned char *)com->val;
-  
-  for(c = 0; c < com->size * 4; c++)
-    key += pnt[c];
-      
+  for (c = 0; c < size; c += 4)
+    {
+      key += pnt[c];
+      key += pnt[c + 1];
+      key += pnt[c + 2];
+      key += pnt[c + 3];
+    }
+
   return key;
 }