Skip to content

Overloaded ticks() function, getting the ticks left for a specific task#58

Open
sixtelgreg wants to merge 3 commits intocontrem:masterfrom
sixtelgreg:get-task-ticks
Open

Overloaded ticks() function, getting the ticks left for a specific task#58
sixtelgreg wants to merge 3 commits intocontrem:masterfrom
sixtelgreg:get-task-ticks

Conversation

@sixtelgreg
Copy link
Copy Markdown

Signed-off-by: Greg sixtelgreg@gmail.com

@skrobinson
Copy link
Copy Markdown
Contributor

Is it a good idea to overload a function name for two conceptually different return values? ticks() returns ticks until next event vs ticks(t) returns ticks until end of t. IMHO, this function should have a distinct name.

A minor style comment...

-             if (duration >= t->expires)
-                 break;
-
-             lft = t->expires - duration;
-             break;
+             if (duration < t->expires)
+                 lft = t->expires - duration;
+             break;

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants