.count() vs .isEmpty()
.count (computed property) is O(n) for non-random access collections, while .isEmpty() is O(1). Keep this in mind for performance.
Example
You have a one section table view which is either going to be empty or very full. We’ve implemented a short circuit.
|
|
Originally published 10/08/2021 @ https://pittcsc.org/ Discord
Published here on 09/16/2022. Blog published date reflects the original date of publication.