Efficient way to write apex code
Set.contains(element) Vs List.contains(element) Guess What if I tell small things Matter!!! If you’re having a cup of tea, pause for a moment because next two minutes will reveal something simple yet less known it the world of Salesforce Set && List your favorite go to during the typical development cycle. But going forward you will definitely double check before using them. For Instance, look at this example Take two set of collections (Set<Integer> and List<Integer>). Now the crux of the discussion which one will give better performance. Lets get technical Which will give better performance Set or List ? a. I f collection is List : List < Integer > listInteger = new List ...