diff options
author | Rich Trott <rtrott@gmail.com> | 2019-11-30 17:04:04 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-12-03 15:00:45 -0800 |
commit | ff2ed3ec858bfed9e2d31e0510614ed3931b499a (patch) | |
tree | 0e3c2eddb6c24a10aca4764187547e2a16d4202e | |
parent | dbdad4d1b518a6a9fde60c9ce61e53b92bda8d38 (diff) | |
download | android-node-v8-ff2ed3ec858bfed9e2d31e0510614ed3931b499a.tar.gz android-node-v8-ff2ed3ec858bfed9e2d31e0510614ed3931b499a.tar.bz2 android-node-v8-ff2ed3ec858bfed9e2d31e0510614ed3931b499a.zip |
http: remove unused hasItems() from freelist
Remove the hasItems() method from freelist module as it is unused
internally.
PR-URL: https://github.com/nodejs/node/pull/30744
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Weijia Wang <starkwang@126.com>
-rw-r--r-- | lib/internal/freelist.js | 4 | ||||
-rw-r--r-- | test/parallel/test-freelist.js | 10 |
2 files changed, 0 insertions, 14 deletions
diff --git a/lib/internal/freelist.js b/lib/internal/freelist.js index 3e93e04f8d..ac2b12c4d4 100644 --- a/lib/internal/freelist.js +++ b/lib/internal/freelist.js @@ -12,10 +12,6 @@ class FreeList { this.list = []; } - hasItems() { - return this.list.length > 0; - } - alloc() { return this.list.length > 0 ? this.list.pop() : diff --git a/test/parallel/test-freelist.js b/test/parallel/test-freelist.js index d0ec3d1e8e..eb43308dbe 100644 --- a/test/parallel/test-freelist.js +++ b/test/parallel/test-freelist.js @@ -28,13 +28,3 @@ assert.strictEqual(flist1.free({ id: 'test5' }), false); assert.strictEqual(flist1.alloc().id, 'test3'); assert.strictEqual(flist1.alloc().id, 'test2'); assert.strictEqual(flist1.alloc().id, 'test1'); - -// Check list has elements -const flist2 = new FreeList('flist2', 2, Object); -assert.strictEqual(flist2.hasItems(), false); - -flist2.free({ id: 'test1' }); -assert.strictEqual(flist2.hasItems(), true); - -flist2.alloc(); -assert.strictEqual(flist2.hasItems(), false); |