UNPKG

foxts

Version:

Opinionated collection of common TypeScript utils by @SukkaW

2 lines (1 loc) 313 B
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Repool=class{constructor(e){this.createObject=e;let t=e();this.tail=t,this.head=t}get(){let e=this.head;if(e.next)this.head=e.next;else{let e=this.createObject();this.tail=e,this.head=e}return e.next=null,e}release(e){this.tail.next=e,this.tail=e}};