Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /usr/share/nodejs/yapool/ drwxr-xr-x | |
| Viewing file: Select action/file-type: module.exports = Pool
function Pool () {
this.length = 0
this.head = null
this.tail = null
}
Pool.prototype.add = function (data) {
this.tail = new Item(data, this.tail, null)
if (!this.head)
this.head = this.tail
this.length ++
}
Pool.prototype.remove = function (data) {
if (this.length === 0)
return
var i = this.head.find(data)
if (!i)
return
if (i === this.head)
this.head = this.head.next
if (i === this.tail)
this.tail = this.tail.prev
i.remove()
this.length --
}
function Item (data, prev) {
this.prev = prev
if (prev)
prev.next = this
this.next = null
this.data = data
}
Item.prototype.remove = function () {
if (this.next)
this.next.prev = this.prev
if (this.prev)
this.prev.next = this.next
this.prev = this.next = this.data = null
}
Item.prototype.find = function (data) {
return data === this.data ? this
: this.next ? this.next.find(data)
: null
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]-- |