Skip to content

chore: simplify code#19

Open
gclaramunt wants to merge 1 commit intomasterfrom
simplify-hosts-map
Open

chore: simplify code#19
gclaramunt wants to merge 1 commit intomasterfrom
simplify-hosts-map

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