Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
\rcharacters can be avoided.