igor.wojda09/06/2021, 6:16 AM
type? Fine / Not Fine? and Why?
val modifiers: Collection<Modifier> = emptyList()
Tomasz Krakowiak09/06/2021, 6:29 AM
calls on large collection, than it's better to convert it to some set implementation first, as some Collection implementation may be not efficient for that. But if you just want to write a function that would iterate over elements and do whatever, than it would be better to accept a `Collection`(or even
), to remove the need of conversion of an arbitrary type of collection the caller uses to one that you use.
Stephan Schroeder09/06/2021, 6:40 AM
, which `Iterable`/`Sequence` doesn't.
provides an order of elements on top of
provides a uniqueness guarantee on top of
would often be good enough (it's nice to iterate and to have the size, if only for log messages or something). But
is shorter to write, so I mostly use
even though I very often don't need any specific order 😅