Minor cleanup - inline throwOnRelease() (#129)

The throwOnRelease() function does not appear to be exposed anywhere,
and it does not appear to make any sense to have it as a standalone func,
as it ovecomplicates things and makes function call as non-returning.  Inlined it.
This commit is contained in:
Yuri Astrakhan 2019-09-04 01:45:45 -04:00 committed by Charmander
parent 70d5c09958
commit 2d2a87392c

View File

@ -25,10 +25,6 @@ class PendingItem {
}
}
function throwOnRelease () {
throw new Error('Release called on client which has already been released to the pool.')
}
function promisify (Promise, callback) {
if (callback) {
return { callback: callback, result: undefined }
@ -248,7 +244,7 @@ class Pool extends EventEmitter {
client.release = (err) => {
if (released) {
throwOnRelease()
throw new Error('Release called on client which has already been released to the pool.')
}
released = true