Skip to content

feat: List extension: fast remove method by swap elements #74

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

Merged
merged 3 commits into from
Jul 26, 2021

Conversation

Yurii-Tor
Copy link
Contributor

Purpose of this PR

Fast method for removing elements from List implemented.

This feature is often on demand. It changes an order of elements inside the list, so not recomended if order matters. Instead of that LinkedList may be used if it feats needs (it's not an IList type)

Testing status

  • No tests have been added.

Manual testing status

Tested in Unity Editor. See link below:
https://share.getcloudapp.com/RBulD2kG

Comments to reviewers

Notice that 'Remove' method deletes only one element, so the predicate evaluation deletes only the first founded. If you need to delete all evaluated elements, use RemoveAll method, which is also fast and doesn't allocate additional resources.

…y index, by item and by predicate evaluation
Copy link
Contributor

@stan-osipov stan-osipov left a comment

Choose a reason for hiding this comment

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

Looks good.
But please convert this test:

Tested in Unity Editor. See link below:
https://share.getcloudapp.com/RBulD2kG

To the actual Uini test.

@stan-osipov
Copy link
Contributor

@Yurii-Tor any luck with the test?

@Yurii-Tor
Copy link
Contributor Author

@Yurii-Tor any luck with the test?

I'm working on it now. Just started

Copy link
Contributor

@stan-osipov stan-osipov left a comment

Choose a reason for hiding this comment

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

Super minor naming requets.
Thank you for the tests.

Copy link
Contributor

@stan-osipov stan-osipov left a comment

Choose a reason for hiding this comment

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

lovely!

@kodiakhq kodiakhq bot merged commit dbeeb2e into master Jul 26, 2021
@kodiakhq kodiakhq bot deleted the listFastRemoveMethodBySwap branch July 26, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants