/*\ module-type: utils title: $:/core/modules/utils/linkedlist.js type: application/javascript This is a doubly-linked indexed list intended for manipulation, particularly pushTop, which it does with significantly better performance than an array. \*/ (function(){ function LinkedList() { this.clear(); }; LinkedList.prototype.clear = function() { // LinkedList performs the duty of both the head and tail node this.next = Object.create(null); this.prev = Object.create(null); this.first = undefined; this.last = undefined; this.length = 0; }; LinkedList.prototype.remove = function(value) { if($tw.utils.isArray(value)) { for(var t=0; t