Merge pull request #13579 from paul-szczepanek-arm/ifbug

double negation fixed and ifs normalised
pull/13594/head
Martin Kojtal 2020-09-10 14:48:02 +01:00 committed by GitHub
commit 98beadde45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 7 deletions

View File

@ -88,16 +88,16 @@ bool is_preferred_connection_params_valid(const Gap::PreferredConnectionParams_t
return false; return false;
} }
if (!is_in_range(params->slaveLatency, slave_latency_min, slave_latency_max) == false) { if (!is_in_range(params->slaveLatency, slave_latency_min, slave_latency_max)) {
return false; return false;
} }
if ((is_in_range(params->maxConnectionInterval, connection_interval_min, connection_interval_max) == false) && if (!is_in_range(params->maxConnectionInterval, connection_interval_min, connection_interval_max) &&
(params->maxConnectionInterval != 0xFFFF)) { (params->maxConnectionInterval != 0xFFFF)) {
return false; return false;
} }
if ((is_in_range(params->minConnectionInterval, connection_interval_min, params->maxConnectionInterval) == false) && if (!is_in_range(params->minConnectionInterval, connection_interval_min, params->maxConnectionInterval) &&
(params->minConnectionInterval != 0xFFFF)) { (params->minConnectionInterval != 0xFFFF)) {
return false; return false;
} }
@ -106,10 +106,7 @@ bool is_preferred_connection_params_valid(const Gap::PreferredConnectionParams_t
return true; return true;
} }
if (( if (!is_in_range(params->connectionSupervisionTimeout, supervision_timeout_min, supervision_timeout_max)) {
is_in_range(params->connectionSupervisionTimeout, supervision_timeout_min, supervision_timeout_max) ==
false
)) {
return false; return false;
} }