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 unused local variable and move local variables into conditional branch #546

Conversation

ken3ypa
Copy link
Contributor

@ken3ypa ken3ypa commented Aug 24, 2023

Found dead code, minor enhancement point and fixed them:

  • Removed unused local variable association_class_name introduced in commit 9937512 .
  • And relocated local variables referenced solely when association_class.paranoid? is true.
  • Streamlined local variable assignments, aligning with the pattern used for association_foreign_key.

delete dead code that became unused due to changes in commit 9937512
…class.paranoid? is true, inside the conditional branch
lib/paranoia.rb Outdated Show resolved Hide resolved
Copy link
Collaborator

@mathieujobin mathieujobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the optimization, just one comment

@mathieujobin mathieujobin merged commit 1db8402 into rubysherpas:core Sep 1, 2023
20 checks passed
@ken3ypa ken3ypa deleted the remove-unused-variable-and-move-variable-in-condition branch September 1, 2023 06:49
karunkumar1ly pushed a commit to edcast/paranoia that referenced this pull request Feb 6, 2024
* Remove unused local variable

delete dead code that became unused due to changes in commit 9937512

* group the assignment to the local variable in the same way as the assignment to association_foreign_key

* move temporary variables, which are only referenced when association_class.paranoid? is true, inside the conditional branch

* simplify association_find_conditions further

---------

Co-authored-by: Mathieu Jobin <[email protected]>
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