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

Reduce Redundancy: Java language fixes #4151

Merged

Conversation

saurabh-rahate
Copy link
Contributor

@saurabh-rahate saurabh-rahate commented Apr 11, 2023

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

This PR contains

  1. Switch case instead of if-else-if for better readability
  2. Usage of enhanced for loop instead of iterator while loop
  3. Usage of collection bulk operation instead of manual loop add
  4. Removal of redundant Collection.addAll
  5. Simplification of switch case
  6. Replacement of C style array declaration with Java style array declaration

@saurabh-rahate saurabh-rahate changed the title Reduce redundancy java lang fixes Reduce Redundancy: Java language fixes Apr 11, 2023
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Well done, thanks!

@siriak siriak merged commit 1dc3886 into TheAlgorithms:master Apr 15, 2023
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