Skip to content

Commit

Permalink
net: replace continue with break to reduce unnecessary loop in xxx_xm…
Browse files Browse the repository at this point in the history
…arksources

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>
  • Loading branch information
RongQing.Li authored and David S. Miller committed Apr 5, 2012
1 parent 51c56b0 commit ce713ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/ipv4/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce713ee

Please sign in to comment.