Skip to content

Commit

Permalink
Merge pull request #301 from CocoaPods/undo-dedupe
Browse files Browse the repository at this point in the history
Undoes #289
  • Loading branch information
orta committed Oct 25, 2016
2 parents 146b8bc + a3bec59 commit 3ed1376
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions assets/javascripts/search.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,6 @@ $(window).ready(function() {
return true;
};

// Removes all duplicates in an array according to their .id value
//
function removeDuplicatesByID(objectsArray) {
var ids = [], collection = [];
$.each(objectsArray, function (index, value) {
if ($.inArray(value.id, ids) == -1) {
ids.push(value.id);
collection.push(value);
}
});
return collection;
}

pickyClient = new PickyClient({
full: searchURL,
fullResults: 20,
Expand Down Expand Up @@ -462,11 +449,7 @@ $(window).ready(function() {
resultsSearchInterface();
}

// Render the JSON into HTML.
// Initially de-duping to avoid memory hiccups e.g. #231 #248
var allocations = data.allocations;
allocations.allocations = removeDuplicatesByID(data.allocations.allocations);

allocations.each(function(i, allocation) {
allocation.entries = allocation.entries.map(function(i, entry) {
return render(entry);
Expand Down

0 comments on commit 3ed1376

Please sign in to comment.