Skip to content

Simplify function timerDelta() #20

Open
@frbehrens

Description

@frbehrens

I believe - because we use for all operands and the result the same integer type - we can simplify the function in ldl_mac.c

static uint32_t timerDelta(uint32_t timeout, uint32_t time)
{
    return (timeout <= time) ? (time - timeout) : (UINT32_MAX - timeout + time);
}

to

static uint32_t timerDelta(uint32_t timeout, uint32_t time)
{
    return (time - timeout);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions