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 unnecessary parameter and dead code #4328

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

moste00
Copy link
Contributor

@moste00 moste00 commented Mar 4, 2024

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

This is a pretty minor change, an internal function insertkeys in librz/util/sdb/src/main.c had an int mode parameter being matched against the 2 values '-' and '='. As per #489 I wanted to remove it in favor of an enum parameter, but when I searched for all the callsites using the name of the function in VSCode full-text search, I found the only callsite to be a call from main passing '-' as an argument. Therefore, I deleted all the code except that which executes for a '-' match, and since there was only 1 code path now, I deleted the redundant mode parameter as will.

...

Test plan

No tests necessary, this is a refactoring of a static function in a .c file with no .h, and thus it can't possibly be used in other files. Its only use in the file defining it is the call described above, which is trivially correct by inspection.

The branch builds correctly, and no additional test case failures (relative to a build on the latest dev branch, where 15 tests fail on my machine in unrelated test cases) is introduced.
...

Closing issues

...

@moste00 moste00 force-pushed the sdb_insertkeys_cleanup branch from 0f07c93 to 526f80a Compare March 4, 2024 14:31
@moste00 moste00 changed the title removed unnecessary parameter and dead code Remove unnecessary parameter and dead code Mar 4, 2024
@XVilka XVilka merged commit f0643cc into rizinorg:dev Mar 5, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants