-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
use _.contains in _.uniq instead of indexOf #1868
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
use _.contains in _.uniq instead of indexOf
This was changed for a slight perf win a while ago - there's already a jsperf somewhere |
But it's the only place that uses it. Either we use one or the other |
Plus it looks like the uniq can be refactored a bit more from here |
Yeah, though if we're going to go that route we should look into #1862 too. I'm not sure underscore is the place (yet) for es6 shims, but probably will be soon. Given that most of these features are still behind flags lets give them some time to mature. |
Things like |
Yep, that's what I was basing my opinion on. Chrome37 has WeakSet and WeakMap but no Set and no Map. The constructors and their arguments are still getting worked out last I remember. |
Naw, it has
Some extra API sugar around constructors is still being implemented across-engines but the set of functionality used by @megawac's proposal and that of #1862 are supported across modern stable browsers. |
Ya, it'd be even nicer to be able to do jsperf for your pleasure of current vs patch http://jsperf.com/set-uniq-underscore |
Keep in mind if you go the |
Hmm, I must have enabled the experimental flag several versions ago and forgotten about it 😀 Besides enabling use of |
Annnd Chrome 38 stable is out with support for |
No description provided.