Content-Length: 248285 | pFad | https://github.com/TheAlgorithms/Go/pull/465

0F Simplify BreadthFirstSearch.go by Primital · Pull Request #465 · TheAlgorithms/Go · GitHub
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

Simplify BreadthFirstSearch.go #465

Merged
merged 1 commit into from
Feb 5, 2022
Merged

Simplify BreadthFirstSearch.go #465

merged 1 commit into from
Feb 5, 2022

Conversation

Primital
Copy link
Contributor

@Primital Primital commented Feb 2, 2022

Remove redundant if clause which condition is always met at line of execution

The condition of the for loop and the if clause are identical, so the condition of the if clause will always be met

I would suggest refactoring line 15,16 to
v, queue := queue[0], queue[1:]
as well, but perhaps it is better to keep it simpler.

Remove redundant if clause which condition is always met at line of execution
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.

LGTM, thanks!

@siriak siriak enabled auto-merge (squash) February 5, 2022 19:44
@siriak siriak merged commit 331446c into TheAlgorithms:master Feb 5, 2022
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.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/TheAlgorithms/Go/pull/465

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy