Order should trigger a sort iff order was changed

In response to https://github.com/jashkenas/backbone/issues/3199 this doesn't make sort fire if the order was unchanged during a `set`.

I'm slightly hesitant about setting `order = false` when `!orderDifferent` but since nothing actually did change wrt the order, it works.
This is checking to see if the new (from what they passed in) model at
index i has a different id than the existing model already in the
collection at index i. If the ids are different then we know they passed in
a different order. Make sense? I realize now it's kinda confusing to
explain.

On Wed, Nov 12, 2014, 3:19 PM Adam Krebs <notifications@github.com> wrote:

> In backbone.js:
>
> > @@ -735,7 +736,14 @@
> >          model = existing || model;
> >          if (!model) continue;
> >          id = this.modelId(model.attributes);
> > -        if (order && (model.isNew() || !modelMap[id])) order.push(model);
> > +        if (order && (model.isNew() || !modelMap[id])) {
> > +          order.push(model);
> > +          //check to see if this is actually a new model at this index
> > +          if (!orderDifferent && (this.models[i] == null || id !== this.modelId(this.models[i].attributes))) {
>
> Also this line probably doesn't need to recompute the modelId. id !==
> this.models[i].id should work here.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jashkenas/backbone/pull/3381/files#r20247541>.
>