Does the size of this method makes sense?

trying to optimize some ram , this method showed up to be biggest one.
trying to figure out if there's a way to save space.

TMWrapper ClockController::change(const DatePart dp, TMWrapper dtv, const delta_t dir)
{
    switch (dp)
    {
    case YEAR:
    {
        return dtv.modifyYear(dir);
    }
    case MONTH:
    {
        return dtv.modifyMonth(dir);
    }
    case DAY:
    {
        return dtv.modifyDay(dir);
    }
    case HOUR:
    {
        return dtv.modifyHour(dir);
    }
    case MINUTE:
    {
        return dtv.modifyMinute(dir);
    }
    case SECOND:
    {
        return dtv.modifySecond(dir);
    }
    default:
    {
        return dtv;
    }
    }
    return dtv;
}

I think that method is "big" because it has inlined most of the dtv.modify... functions that it calls, and that the resulting size is reasonable.

(The screenshot shows flash/program size, rather than RAM size. So it's not very useful if your actual problem is with RAM consumption.)

2 Likes

It doesn't seem to me to use very much RAM.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.