invertase / denque

The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries.
https://docs.page/invertase/denque
Apache License 2.0
354 stars 33 forks source link

remove / splice has bug when count is GE queue.length #9

Closed txchen closed 7 years ago

txchen commented 7 years ago
var dq = new Denque()
dq.push(1)
dq.push(2)
dq.push(3)
dq.splice(0, 3) -> return undefined

I think it should have same behavior like Array.splice()

txchen commented 7 years ago

Maybe the bug is here? https://github.com/invertase/denque/blob/fbfa391c733cf66cb52505969716b178825a1bd3/index.js#L226

txchen commented 7 years ago

@noevents FYI.

noevents commented 7 years ago

@txchen Thanks! I've fixed it in #10.

Salakar commented 7 years ago

@txchen @noevents I have merged the PR and published! Thanks