aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 451 B
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinkedQueue=void 0;class LinkedQueue{constructor(items){if(items)for(const x of items)this.push(x)}push(value){const node={value};this.head&&this.last?(this.last.next=node,this.last=node):(this.head=node,this.last=node)}shift(){if(!this.head)return;const ret=this.head.value;return this.head=this.head.next,this.head||(this.last=void 0),ret}}exports.LinkedQueue=LinkedQueue;