| 1 |
function UpdraftCentral_Queue(){var n=[],e=0,t=!1;this.get_length=function(){return n.length-e},this.is_empty=function(){return 0==n.length},this.enqueue=function(t){n.push(t)},this.is_locked=function(){return t},this.get_lock=function(){return!t&&(this.lock(),!0)},this.dequeue=function(){if(0!=n.length){var t=n[e];return 2*++e>=n.length&&(n=n.slice(e),e=0),t}},this.lock=function(){t=!0},this.unlock=function(){t=!1},this.peek=function(){return 0<n.length?n[e]:void 0},this.replace_front=function(t){return!(n.length<1)&&(n[e]=t,!0)}} |