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

Dispatch correct arguments with can.List:splice if inserting and removing the same elements. #1277

Closed
justinbmeyer opened this issue Oct 17, 2014 · 3 comments · Fixed by #1400 or likethesky/canjs#3
Labels
Milestone

Comments

@justinbmeyer
Copy link
Contributor

Related to: 0b7b107

Something like this should break:

var list = new can.List(["a","b"]);
list.bind("remove", function(ev, items, index){
  equal(items.length, 2);
});
list.splice(0,2,"a","b");

Also, splice is checking every item removed against every item added. n^2 when it should be n.

cc @brianmoschel

BigAB added a commit that referenced this issue Oct 17, 2014
justinbmeyer added a commit that referenced this issue Oct 17, 2014
@daffl daffl added this to the 2.1.4 milestone Oct 22, 2014
@moschel
Copy link
Contributor

moschel commented Nov 5, 2014

@BigAB did you fix this directly in Master? We always fix stuff like that in a branch, add a test to prove its fixed, and only merge after someone has given it a +1.

@moschel
Copy link
Contributor

moschel commented Nov 5, 2014

Oh you did add a test :) But it went directly into master. Can you please close this if all tests are passing and the issue is fixed?

@BigAB
Copy link
Contributor

BigAB commented Nov 5, 2014

I did make a branch and a pull request #1278

There is a test

Justin merged it +1 and merged it.

Yes I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants