Skip to content

Commit

Permalink
remove unnecessary destroy method
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Jul 4, 2024
1 parent 24b6d10 commit 57e0a74
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
5 changes: 0 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion test/pbf.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ function toArray(buf) {

test('initialization', () => {
const buf = new Pbf(Buffer.alloc(0));

Check failure on line 16 in test/pbf.test.js

View workflow job for this annotation

GitHub Actions / test

'buf' is assigned a value but never used

Check failure on line 16 in test/pbf.test.js

View workflow job for this annotation

GitHub Actions / test

'buf' is assigned a value but never used
buf.destroy();
});

test('realloc', () => {
Expand Down

0 comments on commit 57e0a74

Please sign in to comment.