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

Refactor some if-else chains to match or functions on matched item #169

Open
hashedone opened this issue Jun 9, 2023 · 0 comments
Open
Labels

Comments

@hashedone
Copy link
Collaborator

I am not a fan of this if-else chain. I am pretty sure it should be a match or even a function like MsgType::generate_message_variant(...) (not sure about this one, as maybe it is not the best place to put this).

Here you did only minimal changes on this, but let's fix it up in some later refactor (I'll create a task).

Especially since those things look identical. Really. I see the difference, but I think we could simplify it. Not mentioning last else is bullcrap here, I don't see which patterns are not covered; it frustrates me.

Originally posted by @hashedone in #156 (comment)

Also, we should take a look through the codebase to find other instances of similar chains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant