Mostly just for simplicity. However, here’s a nice article by @sasajuric from 3 days ago:
Also: I thought --
was much nicer than MapSet.difference
. I was willing to accept a performance hit for the increased simplicity, but apparent it actually performs better since OTP 22:
As of Erlang/OTP 22, this operation is significantly faster even if both lists are very long, and using
--/2
is usually faster and uses less memory than using theMapSet
-based alternative mentioned above.
3 Likes