Skip to content

fixed two bugs in map.ex that did not correctly deal with nil or falsy values#1

Merged
matt-beanland merged 1 commit into
devfrom
map-nil-bug-fix
Mar 3, 2025
Merged

fixed two bugs in map.ex that did not correctly deal with nil or falsy values#1
matt-beanland merged 1 commit into
devfrom
map-nil-bug-fix

Conversation

@dylanradcliffe
Copy link
Copy Markdown
Collaborator

Found and resolved two suspected bugs in map.ex calculation of outstanding

  1. Where actual has a missing key but the value is nil
iex(2)> outstanding(%{x: :a, y: nil}, %{x: :a, z: :b})
nil
  1. Where actual has the key but wrong value and the expected value is falsy
iex(3)> outstanding(%{x: false}, %{x: 10})
nil

To me (2) definitively seems like a bug, but I could see (1) may not be depending on your expected semantics.

@matt-beanland
Copy link
Copy Markdown
Collaborator

Yes I agree that both of these are bugs and will merge the branch. Gold star awarded 🌟

@matt-beanland matt-beanland merged commit 116bfd4 into dev Mar 3, 2025
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