File: /volume1/@appstore/Spreadsheet/server/common/thread-worker-pool/linked-list.js
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function e(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:true,get:t[i]})}e(exports,{LinkedList:function(){return i},ListNode:function(){return t}});class t{constructor(){this.prev=null;this.next=null}}class i{constructor(){this.head=null;this.size=0}insertFront(e){e.next=this.head;e.prev=null;if(this.head){this.head.prev=e}this.head=e;this.size++}remove(e){const t=e.next;const i=e.prev;if(i){i.next=t}if(t){t.prev=i}if(e===this.head){this.head=t}this.size--}find(e){let t=null;this.forEach((function(i){if(true===e(i)){t=i;return false}}));return t}forEach(e){let t=this.head;while(t&&false!==e(t)){t=t.next}}getSize(){return this.size}shift(){const e=this.head;if(e){this.remove(e)}return e}}