Skip to content

Commit

Permalink
Minor cleanup - inline throwOnRelease() (#129)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nyurik authored and charmander committed Sep 4, 2019
1 parent 70d5c09 commit 2d2a873
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions index.js
Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2d2a873

Please sign in to comment.