Skip to content

Minor bug; health_service_sum_today called twice and/or before is_health_metric_accessible for Step Count widget #137

Description

@howeaj

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions