diff mbox

ieee802_1x_kay.c: Removed continue statement from bottom of for loop

Message ID 1481194859-23695-1-git-send-email-n.chaprana@samsung.com
State Changes Requested
Headers show

Commit Message

Nishant Chaprana Dec. 8, 2016, 11 a.m. UTC
continue statement at bottom of for loop is not required,
so removed continue statement from bottom of for loop.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
---
 src/pae/ieee802_1x_kay.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jouni Malinen Dec. 10, 2016, 5:15 p.m. UTC | #1
On Thu, Dec 08, 2016 at 04:30:59PM +0530, Nishant Chaprana wrote:
> continue statement at bottom of for loop is not required,
> so removed continue statement from bottom of for loop.

While the continue statement here does not really make any difference,
I'm not sure removing it is the correct fix or cleanup here.

> diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
> @@ -1094,7 +1094,6 @@ ieee802_1x_mka_decode_potential_peer_body(
>  			if (peer_mn > participant->mn &&
>  			    !reset_participant_mi(participant))
>  				wpa_printf(MSG_DEBUG, "KaY: Could not update mi");
> -			continue;
>  		}
>  	}

Should that instead break the loop on finding a match (the "it is
myself" check just before this context)? Or is this continue here to
maintain consistent style with other similar functions that actually
continue processing like ieee802_1x_mka_decode_live_peer_body()?

Unless there is better understanding and more justification for removing
the "unnecessary" continue statement, I think I'd rather leave it here
to remain consistent with the other functions and to be more future
proof if something get added to the end of this loop.
diff mbox

Patch

diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
index 1d6d9a9..650fe21 100644
--- a/src/pae/ieee802_1x_kay.c
+++ b/src/pae/ieee802_1x_kay.c
@@ -1094,7 +1094,6 @@  ieee802_1x_mka_decode_potential_peer_body(
 			if (peer_mn > participant->mn &&
 			    !reset_participant_mi(participant))
 				wpa_printf(MSG_DEBUG, "KaY: Could not update mi");
-			continue;
 		}
 	}