health_service_metric_aggregate_averaged_accessible calls health_service_sum_today twice in a row and/or regardless of the is_health_metric_accessible condition:
|
int steps = (int)health_service_sum_today(HealthMetricStepCount); |
|
|
|
if (is_health_metric_accessible(HealthMetricStepCount)) { |
|
steps = (int)health_service_sum_today(HealthMetricStepCount); |
|
} |
Looks like the intention was probably this, found nearby:
|
int distance = 0; |
|
|
|
if (is_health_metric_accessible(HealthMetricWalkedDistanceMeters)) { |
|
distance = |
|
(int)health_service_sum_today(HealthMetricWalkedDistanceMeters); |
|
} |
I think health_service_sum_today returns 0 if !is_health_metric_accessible anyway, so this probably has no effect other than being mildly inefficient.
health_service_metric_aggregate_averaged_accessiblecallshealth_service_sum_todaytwice in a row and/or regardless of theis_health_metric_accessiblecondition:TimeStylePebble/src/c/sidebar_widgets.c
Lines 928 to 932 in 43f5ba4
Looks like the intention was probably this, found nearby:
TimeStylePebble/src/c/sidebar_widgets.c
Lines 889 to 894 in 43f5ba4
I think
health_service_sum_todayreturns0if!is_health_metric_accessibleanyway, so this probably has no effect other than being mildly inefficient.