[PATCH] dbus: Change WPA/RSNIE byte array props to dicts
Fri Jan 15 06:25:37 PST 2010
On Fri, 2010-01-15 at 14:32 +0100, Witold Sowa wrote:
> >> + if ((old->ie_len == new->ie_len) ||
> >> + os_memcmp(old + 1, new + 1, old->ie_len) == 0)
> >> + return changes;
> >> + else
> >> + changes |= WPA_BSS_IES_CHANGED_FLAG;
> >> +
> At first, I've noticed a bug in the condition, the should be AND instead
> of OR. Jouni, please correct this before applying.
> > Why do you bother an else branch here? It just make the code harder to
> > read.
> The else branch is for case that IEs has changed. There is an
> appropriate flag set and after the else statement the WPA/RSN/WPS IEs
> are checked for changes.
The issue is not whether the line "changes |= ..." is needed or not.
The issue is that the "else" is not needed as the previous "return"
limits the control flow to _only_ the "else" code following. So
just remove the "else" and out-dent the "changes |= ..." line.
More information about the Hostap