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(csharp/src/Apache.Arrow.Adbc): Cleanup use of List<T> in APIs and implementation #1761

Merged
merged 5 commits into from
Apr 25, 2024

Conversation

CurtHagenlocher
Copy link
Contributor

Replaces the use of List<T> in most API signatures with IReadOnlyList<T> to allow many different types of collections (such as arrays) to be passed in.

Replaces the use of List<T> in many implementations with T[] for performance and readability benefits.

Closes #1757

@CurtHagenlocher
Copy link
Contributor Author

@davidhcoe, I'd appreciate your review on this.

@github-actions github-actions bot added this to the ADBC Libraries 1.0.0 milestone Apr 24, 2024
#if NET5_0_OR_GREATER
List<T> concreteList = list as List<T>;
if (concreteList != null) { return CollectionsMarshal.AsSpan(concreteList); }
T[] array = list as T[];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, hmm, this doesn't need to be in the #if.

@davidhcoe
Copy link
Contributor

This looks good @CurtHagenlocher and brings things more in line with the pattern that was established with the IReadOnlyDictionary parameters and options.

@CurtHagenlocher CurtHagenlocher merged commit 35d2c76 into apache:main Apr 25, 2024
5 checks passed
@CurtHagenlocher CurtHagenlocher deleted the GH-1757 branch April 25, 2024 14:39
cocoa-xu pushed a commit to meowcraft-dev/arrow-adbc that referenced this pull request May 8, 2024
…d implementation (apache#1761)

Replaces the use of `List<T>` in most API signatures with
`IReadOnlyList<T>` to allow many different types of collections (such as
arrays) to be passed in.

Replaces the use of `List<T>` in many implementations with `T[]` for
performance and readability benefits.

Closes apache#1757
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.

csharp: Cleanup use of List<T> in APIs and implementation
2 participants