mfkl / LibVLCSharp-readonly

.NET bindings for LibVLC
GNU Lesser General Public License v2.1
9 stars 2 forks source link

IEnumerable or Array for public API #7

Closed mfkl closed 6 years ago

mfkl commented 6 years ago

@jeremyVignelles

jeremyVignelles commented 6 years ago

It depends on what we are trying to do. When the size of the returned collection is known in advance and doesn't change, my vote goes to using an Array

mfkl commented 6 years ago

How about Span<T>?

jeremyVignelles commented 6 years ago

Span is pretty new, I'm still wondering how it works. what are the benefits of using it rather than using an array? in which cases would that be profitable?

mfkl commented 6 years ago

This link has some information http://adamsitnik.com/Span/

Looks like there is an implicit cast operator from T[] to Span<T>. Let's go with Arrays for now.