Skip to content

Conversation

@pfee
Copy link

@pfee pfee commented Apr 15, 2022

Issue #53 relates to unwanted carriage return characters.

Their purpose it to redraw an existing line. However they're only needed on occasions where the line needs output more than once. If there's only one version of the line to output, then the \r characters can be avoided.

pfee added 3 commits April 15, 2022 01:07
Since print_page_residency_chart() was only ever called with the first
parameter set to stdout, this API flexibility is not used.  Simplify API
until it's needed by removing the first parameter.
This makes it easier to reason about function, knowing that it's never
called outside this compilation unit.
The carriage return is not needed the first time
print_page_residency_chart() is called.  By moving \r printing to the
caller, it knows which is the first time.

Only within the o_touch loop is print_page_residency_chart() called
multiple times, so only within that loop is \r necessary.

The final call to print_page_residency_chart() has been removed since it
would print identical content to the previous time it was called,
whether than be within the o_touch loop or not.  Hence it has been
removed as all that's needed is to terminate the line with \n.
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.

1 participant