Maintaining sets

Being able to remove duplicate values from lists is great. The problem with this approach is that you have to remove duplicates every time that you run a side-effect. This is wasteful for two reasons:

  • You're storing values that aren't used for anything
  • You have to spend valuable CPU cycles to get rid of them

To counter these issues, you can just use ordered sets instead of lists to prevent duplicates from ever appearing in the first place.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.64.132