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

Adding a dictionary to avoid multiple condition checks and improve code quality. #763

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

ShivamPandya
Copy link
Contributor

Reference

N/A

Describe the pull request

Currently the file is checking for OS to generate a 'system_str'. It is going through the 3 if statements.
If the condition is true for the first one, it will still check for the latter two conditions as the if statements are independent. The process is repeated a several times.

A quick fix to improve the loop would be using 'elif' instead of multiple 'if' statements. But even in that case, we would be experiencing unnecessary looping 66% of the times. A better fix would be using a dictionary. I have added a dictionary to generate the 'system_str' in this PR.

Contributors (in case of a commit with multiple authors)

Co-authors:

@welcome
Copy link

welcome bot commented Apr 15, 2023

Hello there! Welcome to the project! 💖

Thanks for opening your very first pull request here! ✨ We will get back to you as soon as we can. Share on Twitter

Besides, don’t forget to ⭐ the repository, if you haven’t already!

@cruxcode cruxcode merged commit 7d1deed into Atri-Labs:main Apr 18, 2023
@welcome
Copy link

welcome bot commented Apr 18, 2023

Congrats on merging your first pull request! 🎉🎉🎉 Share on Twitter

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