-
Notifications
You must be signed in to change notification settings - Fork 426
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
replaces use of indexOf with more idomatic CoffeeScript #501
Conversation
Is your main goal to get support for IE<9 or to make Spine more clear/consistent? I find indexOf to be more clear than using 'in', but that may just be a personal preference. What do others think? As for the IE<9 thing. My general stance is if there are shims that deal with that easily enough then I don't want to let deprecated browser implementations influence the library any more than they have to. |
I'm trying to accomplish both. I think using
is more clear than
There is no real reason to use The change to list.coffee is probably uglier but that change is more about IE8 than about clarity. |
@aeischeid Personally i think @jschliffer can you commit the JS as well please. Interesting, looks like |
Oh well, I can go with the flow here. It is pretty interesting that looping is faster. That would have been my next minor objection, that index of is probably faster, but that is the opposite of what I expected. Given that I'll just spin it for myself that we are doing this for a performance improvement ;) |
replaces use of indexOf with more idomatic CoffeeScript
Just a detail, but shouldn't this loop use a break? for item, idx in @items
index = idx if item is @current Like: for item, idx in @items when item is @current
index = idx
break Just a little performance thingy ;) |
Yes it should! Nice catch :) |
Removes all use of
Array.prototype.indexOf
to support IE8