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

feat(collections): switch functions to take iterables when possible #3401

Merged
merged 2 commits into from
May 30, 2023

Conversation

Aplet123
Copy link
Contributor

Many functions in the standard library already work with all iterables, so the argument types should be updated to reflect that. I also made small changes with negligible performance implications to joinToString and permutations to make them support iterables.

Unrelated to the rest of the PR, I also changed unzip to use the Array length constructor instead of Array.from since Array.from is for some reason much, much slower.

@Aplet123 Aplet123 requested a review from kt3k as a code owner May 25, 2023 17:33
@CLAassistant
Copy link

CLAassistant commented May 25, 2023

CLA assistant check
All committers have signed the CLA.

const ret: T[][] = [];
const k = inputArray.length;

// Heap's Algorithm
Copy link
Member

@kt3k kt3k May 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor point, but I think this comment shouldn't be moved here as this seems referring to the algorithm in the below while loop

@Aplet123
Copy link
Contributor Author

@kt3k I've moved the comment back down to where it was originally.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your contribution!

@kt3k kt3k merged commit 5199824 into denoland:main May 30, 2023
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

Successfully merging this pull request may close these issues.

3 participants