Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate function declaration in Row.h #1554

Merged
merged 1 commit into from
Oct 12, 2024
Merged

Conversation

AryanGitHub
Copy link
Contributor

just removed the line 125th line.

void Row_display(const Object* cast, RichString* out);
Fixes #1553

Thanks.

@BenBE BenBE added the code quality ♻️ Code quality enhancement label Oct 12, 2024
@BenBE
Copy link
Member

BenBE commented Oct 12, 2024

Thank you for your PR.

The duplicate declaration of a function in C isn't usually a bug, as you can have as many of them as you like as long as they all agree with each other.

In the context of Row.h there is a small difference between functions called Row_display (present current state) and Row_print… (prepare this visual state). Thus keeping the first one in favour of the second one below makes semantically a bit more sense, as it keeps the actions an user want's to perform with the row (create, free, display its contents) together, while having the operations needed for maintenance (filling its presentation with data to display) in a group below.

@BenBE BenBE added this to the 3.4.0 milestone Oct 12, 2024
@BenBE BenBE merged commit 4102862 into htop-dev:main Oct 12, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality ♻️ Code quality enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Row.h has a duplicate function declaration.
2 participants