Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variant of ObservableArrayType.reduce that reduces over a mapping #8

Closed
lorentey opened this issue Oct 24, 2016 · 1 comment
Closed

Comments

@lorentey
Copy link
Collaborator

lorentey commented Oct 24, 2016

Mapping an array requires maintaining an index mapping, which is superfluous when we're going to ignore the ordering anyway; so array.map{$0.someInteger}.sum() does extra work.

@lorentey
Copy link
Collaborator Author

lorentey commented Nov 3, 2016

Ugh, not really. If the key is not observable, then reduce's add and remove can already extract it on the fly. If it is observable, then it may change on its own, so array.map{$0.someInteger}.reduce(…) is the way to go.

@lorentey lorentey closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant