New IList<T> extension method - Swap by falwickster · Pull Request #13 · zzzprojects/Z.ExtensionMethods · GitHub
Skip to content

New IList<T> extension method - Swap#13

Merged
JonathanMagnan merged 4 commits into
zzzprojects:masterfrom
falwickster:master
Jul 11, 2018
Merged

New IList<T> extension method - Swap#13
JonathanMagnan merged 4 commits into
zzzprojects:masterfrom
falwickster:master

Conversation

@falwickster

@falwickster falwickster commented Jun 13, 2018

Copy link
Copy Markdown
Contributor

Hello

This is my first pull request, this is a new extension method to replace an item in a collection when the item we want to change exists in a collection. Otherwise it won't make any changes.

EDIT: I have noticed that all ICollection methods are void or bool, so I rewrote the method to be void. I have it on my fork.

@JonathanMagnan JonathanMagnan self-assigned this Jun 13, 2018
@JonathanMagnan

Copy link
Copy Markdown
Member

@falwickster

falwickster commented Jun 13, 2018

Copy link
Copy Markdown
Contributor Author

Hello @JonathanMagnan,

Thanks for feedback. I replaced this ICollection method to IList method, because as far as I know ICollection doesn't store indexes, so swaping items with keeping its position is problematic.

Best Regards

@falwickster falwickster changed the title New ICollection<T> extension method - Swap New IList<T> extension method - Swap Jun 13, 2018
@JonathanMagnan

Copy link
Copy Markdown
Member

Thank a lot ;)

Best Regards,

Jonathan

@JonathanMagnan JonathanMagnan merged commit b98b17d into zzzprojects:master Jul 11, 2018
@JonathanMagnan

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants