-
Notifications
You must be signed in to change notification settings - Fork 87
Add flattenedToList and flattenedToSet #328
Conversation
For iterables which are known to be exhausted after flattening performance is better than the `sync*` implementation using a collection literal. Add `flattenedToList` as a performance improvement over `flattened.` Add `flattenedToSet` as new behavior for flattening to unique elements. Originally implemented in dart-lang/sdk@8d3b6ce
cc @scheglov - any concerns about landing this here? You might need to handle import conflicts when this version gets pulled in to the SDK. |
I'm not sure if we want to hold this on #284 - we also have another new API on that branch waiting for publish. |
If someone needs this, it's fine to release it in 2.X, and merge it into the 3.0 branch too. I really should get back to releasing the 3.0 version. |
https://dart-review.googlesource.com/c/sdk/+/346163 renames these methods in the analyzer, so there will be no conflict. I will migrate once this PR lands, and |
We might get it into package:collection dart-archive/collection#328 So, I rename it in the analyzer to prevent future conflict. Change-Id: I8cee41e76cb0f3c7147eda2b7284cec9f57aea92 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346163 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
@natebosch – care to proceed? |
For iterables which are known to be exhausted after flattening performance is better than the `sync*` implementation using a collection literal. Add `flattenedToList` as a performance improvement over `flattened.` Add `flattenedToSet` as new behavior for flattening to unique elements. Originally implemented in dart-lang/sdk@8d3b6ce
For iterables which are known to be exhausted after flattening
performance is better than the
sync*
implementation using a collectionliteral.
Add
flattenedToList
as a performance improvement overflattened.
Add
flattenedToSet
as new behavior for flattening to unique elements.Originally implemented in
dart-lang/sdk@8d3b6ce