unfix: add some bugs

呃这个可能有点炸了
This commit is contained in:
2025-10-16 17:39:50 +08:00
Unverified
parent 392a6a604c
commit 730a701deb
2049 changed files with 188059 additions and 122 deletions

View File

@@ -0,0 +1,33 @@
'use strict'
function reusify (Constructor) {
var head = new Constructor()
var tail = head
function get () {
var current = head
if (current.next) {
head = current.next
} else {
head = new Constructor()
tail = head
}
current.next = null
return current
}
function release (obj) {
tail.next = obj
tail = obj
}
return {
get: get,
release: release
}
}
module.exports = reusify