PHP 8.2.30
Preview: queue.js Size: 1.83 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/bluebird/js/release/queue.js

"use strict";
function arrayMove(src, srcIndex, dst, dstIndex, len) {
    for (var j = 0; j < len; ++j) {
        dst[j + dstIndex] = src[j + srcIndex];
        src[j + srcIndex] = void 0;
    }
}

function Queue(capacity) {
    this._capacity = capacity;
    this._length = 0;
    this._front = 0;
}

Queue.prototype._willBeOverCapacity = function (size) {
    return this._capacity < size;
};

Queue.prototype._pushOne = function (arg) {
    var length = this.length();
    this._checkCapacity(length + 1);
    var i = (this._front + length) & (this._capacity - 1);
    this[i] = arg;
    this._length = length + 1;
};

Queue.prototype.push = function (fn, receiver, arg) {
    var length = this.length() + 3;
    if (this._willBeOverCapacity(length)) {
        this._pushOne(fn);
        this._pushOne(receiver);
        this._pushOne(arg);
        return;
    }
    var j = this._front + length - 3;
    this._checkCapacity(length);
    var wrapMask = this._capacity - 1;
    this[(j + 0) & wrapMask] = fn;
    this[(j + 1) & wrapMask] = receiver;
    this[(j + 2) & wrapMask] = arg;
    this._length = length;
};

Queue.prototype.shift = function () {
    var front = this._front,
        ret = this[front];

    this[front] = undefined;
    this._front = (front + 1) & (this._capacity - 1);
    this._length--;
    return ret;
};

Queue.prototype.length = function () {
    return this._length;
};

Queue.prototype._checkCapacity = function (size) {
    if (this._capacity < size) {
        this._resizeTo(this._capacity << 1);
    }
};

Queue.prototype._resizeTo = function (capacity) {
    var oldCapacity = this._capacity;
    this._capacity = capacity;
    var front = this._front;
    var length = this._length;
    var moveItemsCount = (front + length) & (oldCapacity - 1);
    arrayMove(this, 0, this, oldCapacity, moveItemsCount);
};

module.exports = Queue;

Directory Contents

Dirs: 0 × Files: 37

Name Size Perms Modified Actions
421 B lrw-r--r-- 2026-02-21 00:53:44
Edit Download
1.61 KB lrw-r--r-- 2026-02-21 00:53:44
Edit Download
2.81 KB lrw-r--r-- 2026-02-21 00:53:46
Edit Download
1.92 KB lrw-r--r-- 2026-02-21 00:53:46
Edit Download
291 B lrw-r--r-- 2026-02-21 00:53:48
Edit Download
4.25 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
3.62 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
1.39 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
2.33 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
31.42 KB lrw-r--r-- 2026-02-21 00:53:52
Edit Download
1.36 KB lrw-r--r-- 2026-02-21 00:53:54
Edit Download
789 B lrw-r--r-- 2026-02-21 00:53:54
Edit Download
3.63 KB lrw-r--r-- 2026-02-21 00:53:56
Edit Download
1.93 KB lrw-r--r-- 2026-02-21 00:53:56
Edit Download
314 B lrw-r--r-- 2026-02-21 00:53:56
Edit Download
4.50 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
7.58 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
7.95 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
5.47 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
1.73 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
1.52 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
1.61 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
26.35 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
5.13 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
11.90 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
3.04 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
1.83 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
1.22 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
5.25 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.10 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
1.33 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
3.87 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.75 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.08 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.34 KB lrw-r--r-- 2026-02-21 00:54:02
Edit Download
7.35 KB lrw-r--r-- 2026-02-21 00:54:02
Edit Download
11.11 KB lrw-r--r-- 2026-02-21 00:54:02
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).