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

chore: simplify code #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

chore: simplify code #19

wants to merge 1 commit into from

Conversation

gclaramunt
Copy link
Contributor

replace NonEmptyMap[Addr, Option[List[Info]]] with NonEmptyMap[Addr, List[Info]]]

@kpudlik
Copy link
Contributor

kpudlik commented Nov 26, 2024

That change is valid only if there is no semantic difference between list that doesn't exist and list that exists but is empty. Have you confirmed that there is no difference for that particular case?

We also often use Option[NonEmptyList[A]] for similar cases to be sure that we either do not have a list or have a list that is for sure non-empty.

@gclaramunt
Copy link
Contributor Author

well... this is actually closer to the Option[NonEmptyList[A]] since the list comes from /cluster/info and it will never should be empty (it always include self) ... In that case I wouldn't mind too much, since is totally equivalent to List[A]

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