Skip to content

Simplify BreadthFirstSearch.go#465

Merged
siriak merged 1 commit intoTheAlgorithms:masterfrom
Primital:patch-1
Feb 5, 2022
Merged

Simplify BreadthFirstSearch.go#465
siriak merged 1 commit intoTheAlgorithms:masterfrom
Primital:patch-1

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