diff options
author | RongQing.Li <roy.qing.li@gmail.com> | 2012-04-05 05:36:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-05 05:42:18 -0400 |
commit | ce713ee5a10f3a171df94b0d501034aab2388c16 (patch) | |
tree | fc51b89dc562d3b49bc6db964f405fda0575c03d | |
parent | 51c56b004e2c9a46207bb8a116589c2f84b92e5d (diff) |
net: replace continue with break to reduce unnecessary loop in xxx_xmarksources
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>
-rw-r--r-- | net/ipv4/igmp.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 450e5d21ed2a..e9b90a8ca55a 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -775,7 +775,7 @@ static int igmp_xmarksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs) | |||
775 | if (psf->sf_count[MCAST_INCLUDE] || | 775 | if (psf->sf_count[MCAST_INCLUDE] || |
776 | pmc->sfcount[MCAST_EXCLUDE] != | 776 | pmc->sfcount[MCAST_EXCLUDE] != |
777 | psf->sf_count[MCAST_EXCLUDE]) | 777 | psf->sf_count[MCAST_EXCLUDE]) |
778 | continue; | 778 | break; |
779 | if (srcs[i] == psf->sf_inaddr) { | 779 | if (srcs[i] == psf->sf_inaddr) { |
780 | scount++; | 780 | scount++; |
781 | break; | 781 | break; |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 16c33e308121..6264d8fd2a2d 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1061,7 +1061,7 @@ static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs, | |||
1061 | if (psf->sf_count[MCAST_INCLUDE] || | 1061 | if (psf->sf_count[MCAST_INCLUDE] || |
1062 | pmc->mca_sfcount[MCAST_EXCLUDE] != | 1062 | pmc->mca_sfcount[MCAST_EXCLUDE] != |
1063 | psf->sf_count[MCAST_EXCLUDE]) | 1063 | psf->sf_count[MCAST_EXCLUDE]) |
1064 | continue; | 1064 | break; |
1065 | if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { | 1065 | if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { |
1066 | scount++; | 1066 | scount++; |
1067 | break; | 1067 | break; |