diff --git a/backbone.js b/backbone.js index b1a58165..4b151da2 100644 --- a/backbone.js +++ b/backbone.js @@ -834,16 +834,6 @@ return this; }, - // Figure out the smallest index at which a model should be inserted so as - // to maintain order. - sortedIndex: function(model, value, context) { - value || (value = this.comparator); - var iterator = _.isFunction(value) ? value : function(model) { - return model.get(value); - }; - return _.sortedIndex(this.models, model, iterator, context); - }, - // Pluck an attribute from each model in the collection. pluck: function(attr) { return _.invoke(this.models, 'get', attr); diff --git a/index.html b/index.html index a06f7e39..4f893b7e 100644 --- a/index.html +++ b/index.html @@ -1686,7 +1686,6 @@ alert(JSON.stringify(collection));
  • min
  • sortBy
  • groupBy
  • -
  • sortedIndex
  • shuffle
  • toArray
  • size
  • diff --git a/test/collection.js b/test/collection.js index 05b5af7f..f47644ca 100644 --- a/test/collection.js +++ b/test/collection.js @@ -522,18 +522,6 @@ $(document).ready(function() { deepEqual(col.difference([c, d]), [a, b]); }); - test("sortedIndex", function () { - var model = new Backbone.Model({key: 2}); - var collection = new (Backbone.Collection.extend({ - comparator: 'key' - }))([model, {key: 1}]); - equal(collection.sortedIndex(model), 1); - equal(collection.sortedIndex(model, 'key'), 1); - equal(collection.sortedIndex(model, function (model) { - return model.get('key'); - }), 1); - }); - test("reset", 12, function() { var resetCount = 0; var models = col.models;