From 2d2a87392ceaf73ba0d2ed13ed9f6857e1d72ddd Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Wed, 4 Sep 2019 01:45:45 -0400 Subject: [PATCH] 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. --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index e93cc96c..e517f76f 100644 --- a/index.js +++ b/index.js @@ -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