Skip to content

Conversation

@mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Oct 14, 2022

  • Removes Iterator.equals as this method is completely unused except in a test
  • Replace Iterator.collect with Array.from
  • Use asArray instead of Iterable.single in a few cases
  • Remove Iterable.forEach and replace single caller with for/of lopp
  • If passing an array to one of the other Iterable methods, we don't need to call Iterable.from on it first
  • When we create an iterable from an array and then convert that iterable back to an array right away, we should just operate on the array (this lets us remove the one caller of Iterable.concatNested)

- Removes `Iterator.equals` as this was unused
- Replace `Iterator.collect` with `Array.from`
- Use `asArray` instead of `Iterable.single` in a few cases
- Remove `Iterable.forEach` and replace single caller with `for/of`
- If passing an array to `Iterable`, we don't need to call `Iterable.from` on it
- When we create an iterable from an array and then convert that iterable back to an array right away, we should just operate on the array (this lets us remove the one caller to `concatNested`)
@mjbvz mjbvz added this to the October 2022 milestone Oct 14, 2022
@mjbvz mjbvz self-assigned this Oct 14, 2022
@jrieken
Copy link
Member

jrieken commented Oct 17, 2022

Use asArray instead of Iterable.single in a few cases

Is that actually better? The asArray-util always creates a new array which can be avoided with single (and was the reasons for its existence). Maybe a better pattern for Array.isArray(prefix) ? prefix : Iterable.single(prefix) is needed, something like Iterator.wrap(n) where n is iterable or a single item

@mjbvz mjbvz merged commit 89f0c65 into microsoft:main Oct 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants