Skip to content
Snippets Groups Projects
Commit bce1699f authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #9607: made unique function of Array prototype faster

parent abea4af9
No related branches found
No related tags found
No related merge requests found
......@@ -46,14 +46,12 @@ app.filter('secondsToHHmmss', function($filter) {
//filter unique items in array
Array.prototype.unique = function() {
var unique = [];
var unique = {};
var length = this.length;
for (var i = 0; i < length; i++) {
var item = this[i];
if (unique.indexOf(item) == -1) {
unique.push(item);
}
unique[item] = true;
}
return unique;
return Object.keys(unique);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment