Forcetalks | William Alexander Aldana Carvajal | Activity https://www.forcetalks.com/william-alexander-aldana-carvajal/activity/ Activity feed for William Alexander Aldana Carvajal. Sat, 20 Dec 2025 10:06:46 +0530 https://buddypress.org/?v=2.16.0 en-US 30 hourly 2 846e5ce81aabb6f428fff48bc91a8c26 William Alexander Aldana Carvajal replied to the discussion Difference between list.Size() > 0 vs list != null vs list.IsEmpty() in Salesforce? in the forum Salesforce® Discussions https://www.forcetalks.com/salesforce-topic/difference-between-list-size-0-vs-list-null-vs-list-isempty/#post-68222 Fri, 31 Jan 2020 20:27:10 +0530 Reply to Difference between list.Size() > 0 vs list != null vs list.IsEmpty() in Salesforce?

List.Size() is slow because needs to count all the elements in the collection.

List.IsEmpty() only checks zero position has value.

if you joins list != null and !list.IsEmpty() you will avoid possible null exceptions.

I've read the difference is approximately 10%. I have not checked it but has a sense

 

]]>
5caf1e3661a1748ca4ce321041e80be5 William Alexander Aldana Carvajal became a registered member https://www.forcetalks.com/activity/p/100451/ Fri, 31 Jan 2020 20:19:27 +0530 0