net: replace continue with break to reduce unnecessary loop in xxx_xmarksources
authorRongQing.Li <roy.qing.li@gmail.com>
Thu, 5 Apr 2012 09:36:29 +0000 (17:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Apr 2012 09:42:18 +0000 (05:42 -0400)
The conditional which decides to skip inactive filters does not
change with the change of loop index, so it is unnecessary to
check them many times.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/igmp.c
net/ipv6/mcast.c

index 450e5d21ed2af271574874479bd0c0d341bf6b38..e9b90a8ca55a7ced403e7afbc98bada52b8b19de 100644 (file)
@@ -775,7 +775,7 @@ static int igmp_xmarksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs)
                        if (psf->sf_count[MCAST_INCLUDE] ||
                            pmc->sfcount[MCAST_EXCLUDE] !=
                            psf->sf_count[MCAST_EXCLUDE])
-                               continue;
+                               break;
                        if (srcs[i] == psf->sf_inaddr) {
                                scount++;
                                break;
index 16c33e308121da59c61629a13fa239dada189874..6264d8fd2a2d64808658b28d1e0a4b1f05ddaf85 100644 (file)
@@ -1061,7 +1061,7 @@ static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs,
                        if (psf->sf_count[MCAST_INCLUDE] ||
                            pmc->mca_sfcount[MCAST_EXCLUDE] !=
                            psf->sf_count[MCAST_EXCLUDE])
-                               continue;
+                               break;
                        if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
                                scount++;
                                break;