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

[BUG] unreachable code? #12

Closed
chris-ha458 opened this issue Sep 28, 2023 · 4 comments
Closed

[BUG] unreachable code? #12

chris-ha458 opened this issue Sep 28, 2023 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@chris-ha458
Copy link
Contributor

Describe the bug
This part of the code seems to be unreachable

The outer if ensures that cohrerence_difference is not 0.0.
So that particular if statement should never be reached.

To Reproduce
I don't know the intended case for these statements so I cannot reproduce the "negative case"

Expected behavior
maybe the outer if needs to be different.
In the original python code, chaos_difference == 0.0 and self.coherence == other.coherence this comparison is used.

@chris-ha458 chris-ha458 added bug Something isn't working help wanted Extra attention is needed labels Sep 28, 2023
@chris-ha458
Copy link
Contributor Author

semantically, it seems that both code is identical so I made an issue there as well.
jawah/charset_normalizer#350

@nickspring
Copy link
Owner

I guess it can be removed :)

@chris-ha458
Copy link
Contributor Author

I will wait for the original repo to respond before doing anything. I might missing something.

That being said the code can be simplified quite a bit if we can remove one predicate or the whole if statement.

@nickspring
Copy link
Owner

It was confirmed in original repo that's dead code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants