-
Notifications
You must be signed in to change notification settings - Fork 171
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
Expose overloads of the set methods that operate on collections #4226
Comments
➤ Yavor Georgiev commented: [~simon.ulsnes] is this possible to implement? |
➤ Simon Ulsnes commented: It is possible to implement (anything is �), but what are the expectations? The standard library algorithms that we use assume that the input is already a sorted range of unique elements, and I guess we could not do that for List and Result. There are also some design considerations with Object Store's Set, where the caller has to indicate the type of the input list, which is going to be awkward. Some thought is required there. |
➤ Nikola Irinchev commented: The .NET implementation accepts any collection as an argument to Union/Difference/etc. We do a runtime cast to check if the argument is an in-memory collection or a Realm-backed collection (such as List/Results/Set).
The reason why #2 has to be implemented in native code is that the general-purpose implementation written in C# would be extremely slow due to the native-managed transitions. There will likely be a similar consideration for Java, which is why it'd be ideal to have these methods implemented in OS. |
.NET and Java need to expose an API where we call a set-specific method on a set with a non-set argument, such as Results or List. So we should ensure that all methods outlined in #4225 can accept any of the collection types. They should special case the Set argument case to provide a more efficient implementation, but should also work (slower) on results and lists.
The text was updated successfully, but these errors were encountered: