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

Fix unreachable code in storm set function #114

Conversation

Thedarkmatter10
Copy link
Contributor

@Thedarkmatter10 Thedarkmatter10 commented Apr 17, 2024

Fix Unreachable Code in stormSet Function

Description:
This pull request addresses the "unreachable code" error encountered in the stormSet function. The issue arises due to the conn.Close() statement being unreachable after a return statement. To resolve this, the code has been rearranged to ensure that the conn.Close() statement is reachable and executed properly. Additionally, a defer statement has been added at the beginning of the function to ensure proper cleanup of resources even if the function returns early due to an error. This improves the reliability and maintainability of the codebase.

Changes Made:

  1. Moved the conn.Close() statement to a reachable location in the function.
  2. Added a defer statement to ensure the connection is closed when the function exits, improving code readability and maintainability.

@arpitbbhayani
Copy link
Contributor

Good catch :) Thanks.

@arpitbbhayani arpitbbhayani merged commit d95d559 into DiceDB:master Jun 30, 2024
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