foxts
Version:
Opinionated collection of common TypeScript utils by @SukkaW
1 lines • 292 B
JavaScript
class t{createObject;head;tail;constructor(t){this.createObject=t;const e=t();this.tail=e,this.head=e}get(){const t=this.head;if(t.next)this.head=t.next;else{const t=this.createObject();this.tail=t,this.head=t}return t.next=null,t}release(t){this.tail.next=t,this.tail=t}}export{t as Repool};