-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat!: Introduce new ReadOnlyOrderedSet super-interface #59
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
Conversation
Benchmark ResultsPackage ordered_set:
Benchmarks provided with 💙 by Dart Benchmark Action. |
…ll sets Queryable)
e6d6317 to
c210922
Compare
| void main() { | ||
| OrderedSet<K> comparing<K>(Mapper<K> mapper) { | ||
| return OrderedSet.comparing<K>(Comparing.on(mapper)); | ||
| return OrderedSet.comparing<K>(compare: Comparing.on(mapper)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dart doesn't allow named and optional parameters on the same function sadly:
https://dart.dev/language/functions
honestly I am considering just making the compare function mandatory, and then removing the "default compare" nastyness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite nice to be able to just plug in Comparables without having to specify the compare function though, because that is supported today right?
Not sure if we should think of other users than Flame for this package, because maybe there are none. 😅
Pull Request Test Coverage Report for Build 15165692203Details
💛 - Coveralls |
ed14e5e to
5ee06ee
Compare
5ee06ee to
f7eb6cd
Compare
|
Note: the performance drop on insert is due to strictMode being active by default on all ordered sets now. |
I'd say it would be better to have it deactivated by default? And then if the user uses |
|
@spydon maybe we can call it DISABLED (default) - do not pre-register and just errors if query or whereType are used |
I don't see why the disabled one is needed? And I would have on demand as the default instead. |
|
@spydon the disable one is to teach users the best way of doing things, otherwise they will just use query all the time and never know they are paying a penalty |
But I'm not sure that most use the query feature (if this package even has some other users than Flame 😂), and then they will get the performance penalty without getting anything for it. |
|
why would they get a performance penalty with the default disable mode? it is quite the opposite... |
Ah yeah, sorry, I meant if there would only be two modes and pre-register would be the default. Let's go with disabled then! |
|
LGTM! |
Introduce new
ReadOnlyOrderedSetsuper-interface.Also makes all sets Queryable, removing the prior distinction.