From 57e0a742f75d773aa59946302b5df05e36bba17c Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 4 Jul 2024 20:02:19 +0300 Subject: [PATCH] remove unnecessary destroy method --- README.md | 1 - index.js | 5 ----- test/pbf.test.js | 1 - 3 files changed, 7 deletions(-) diff --git a/README.md b/README.md index 7f78ffc..c5c2f84 100644 --- a/README.md +++ b/README.md @@ -269,7 +269,6 @@ Misc methods: * `realloc(minBytes)` - pad the underlying buffer size to accommodate the given number of bytes; note that the size increases exponentially, so it won't necessarily equal the size of data written * `finish()` - make the current buffer ready for reading and return the data as a buffer slice -* `destroy()` - dispose the buffer For an example of a real-world usage of the library, see [vector-tile-js](https://github.com/mapbox/vector-tile-js). diff --git a/index.js b/index.js index f610634..e289fd0 100644 --- a/index.js +++ b/index.js @@ -21,11 +21,6 @@ export default class Pbf { this.length = this.buf.length; } - destroy() { - this.buf = null; - this.dataView = null; - } - // === READING ================================================================= readFields(readField, result, end = this.length) { diff --git a/test/pbf.test.js b/test/pbf.test.js index 6ab2d1f..cfb5f9d 100644 --- a/test/pbf.test.js +++ b/test/pbf.test.js @@ -14,7 +14,6 @@ function toArray(buf) { test('initialization', () => { const buf = new Pbf(Buffer.alloc(0)); - buf.destroy(); }); test('realloc', () => {