Aregev2
08/06/2018, 5:27 PMisEmpty() and none()?Shawn
08/06/2018, 5:28 PMShawn
08/06/2018, 5:28 PMIterableAregev2
08/06/2018, 5:28 PMAregev2
08/06/2018, 5:28 PMAregev2
08/06/2018, 5:29 PMnone() (not none { })adam-mcneilly
08/06/2018, 5:30 PMisEmpty() is on a collection but none() is on an Iterable specifically. I'm guessing it's possible for something to be iterable and not a collection and that's where you can use it?Aregev2
08/06/2018, 5:31 PMadam-mcneilly
08/06/2018, 5:33 PMadam-mcneilly
08/06/2018, 5:33 PMnone()Aregev2
08/06/2018, 5:33 PMAregev2
08/06/2018, 5:34 PMadam-mcneilly
08/06/2018, 5:45 PMadam-mcneilly
08/06/2018, 5:46 PMif (this is Collection) return isEmpty()
return !iterator().hasNext()karelpeeters
08/06/2018, 6:28 PMisEmpty() too.karelpeeters
08/06/2018, 6:28 PMfind and firstOrNull, just pick one.elye
08/07/2018, 6:47 AMsequence.none() but not sequence.isEmpty(). What is sequence? Check out https://medium.com/@elye.project/kotlin-slow-list-and-lazy-sequence-61691fc974c5Andreas Sinz
08/07/2018, 3:05 PMCollection.isEmpty() checks if there is anything inside the collection, Iterator.none() checks if any items are left to iterate overkarelpeeters
08/07/2018, 3:10 PMIterable.none, you don't start with an existing iterator.Andreas Sinz
08/07/2018, 3:12 PM