--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/a1bb3c5f-9007-4c2b-bf36-0cc31fca0a94%40dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAPiP%2BgteV646_bSr%3D66MpVCS5NXvJCeUEPwRrq3YCRUJHCTSSQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CA%2BeWuVCPWOL76Fr5g99rQHY%3DSCL%3DB6w4qQk1dOJv_mJdpZtjQw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CA%2BeWuVCPWOL76Fr5g99rQHY%3DSCL%3DB6w4qQk1dOJv_mJdpZtjQw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CA%2BeWuVCPWOL76Fr5g99rQHY%3DSCL%3DB6w4qQk1dOJv_mJdpZtjQw%40mail.gmail.com.
Why would [...list] be any less performant than list.toList()? Both of them have to work with Iterable as well as List, and both could in principle be optimized if list is statically known to already be a List.
I personally prefer List.of(). It may be slightly less performant, but it's predictable in that you always know exactly what type of list you're getting—you don't run the risk of potentially getting passed a weird custom List whose toList() also returns a weird custom List. I generally value predictable edge-case behavior over slight performance edges. ([...list] is also predictable, but I prefer words to punctuation where equivalent).
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAKDS1k7o3nFzjOJa_%2B4xvpMjiyYbEodqFLoLCRrxp9rPsiLhRA%40mail.gmail.com.