Skip to content

Simplify function timerDelta() #20

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);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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