siromivel / lambdeth

A functional library for the EVM built in Solidity
MIT License
12 stars 2 forks source link

Unique is Omitting 0 #16

Closed siromivel closed 5 years ago

siromivel commented 5 years ago

I ran into this while making map support currying(#10) - it looks like unique is omitting 0 from the resulting array. I check contains thinking that may be the problem but it seems to handle 0 just fine. Looking at this now but wanted to ensure it is documented, so creating an issue for it.

siromivel commented 5 years ago

Ok, this is actually a bug in the contains method - it always returns true for 0 which causes unique to omit the value regardless of it's existence in the return array.