-
Notifications
You must be signed in to change notification settings - Fork 23
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(array-prototype): add splice method #451
Conversation
Hey, and thank you again! From a quick glance looks like you're getting into the flow here and fairly easily cranking these out :) A fast path here would be... First thing would be the usual "Object is an Array and it is trivial and dense" (wait, should it be "simple and dense"? I think "trivial" was a combination of "simple and dense"? anyway), of course. But together with that we should check that the start and delete counts are Integers. Then we can probably make up a few different internal fast paths:
The first is best done with first a The second is first a The third is of course just a return. The fourth is a The fifth is a The sixth one is a These different parts can probably be combined into a single whole where most steps are conditional on some thing or another, but it's probably more efficient to split the code up like this; take on branch at the beginning and do the most of the work without extra branching. |
0eb4460
to
55d16cc
Compare
I handled the merge conflict: Do you want to take a stab at the fast path(s?) @ivandevp or should I merge this as-is? |
Hey @aapoalas , apologies for the late reply. Can I just fix the merge conflict for now and add the fast path in a separate PR? I got busy with current job change that I think I'm not going to have time to do it soon. |
Of course, and don't worry about it! I'm really happy and thankful that you've contributed so much already, and especially with OSS there is absolutely no requirements here :) I can take care of the merge conflict as well if that's easier for you <3 |
Thanks @aapoalas, I just fixed the merge conflicts :) |
Hi!
This PR aims to add
Array.prototype.splice
method. Few tests are still failing but they're because of using uninplemented constructors likeProxy
I think. Also, I haven't added a fast path - not sure ifVec::splice
could be used for this purpose - any recommendation or guidance is highly appreciated.