Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed May 22, 2024
1 parent b559e4d commit 9f24c50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions node/src/Channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ export class Channel extends EnhancedEventEmitter {
// Finalizes the buffer.
this.#bufferBuilder.finish(messageOffset);

// Create a new buffer with this data so multiple contiguous flatbuffers
// do not point to the builder buffer overriding others info.
// Take a reference of the inner buffer.
const buffer = this.#bufferBuilder.asUint8Array();

// Clear the buffer builder so it's reused for the next request.
// NOTE: This merely resets the buffer offset, it does not clear the content.
this.#bufferBuilder.clear();

if (buffer.byteLength > MESSAGE_MAX_LEN) {
Expand Down Expand Up @@ -317,11 +317,11 @@ export class Channel extends EnhancedEventEmitter {
// Finalizes the buffer.
this.#bufferBuilder.finish(messageOffset);

// Create a new buffer with this data so multiple contiguous flatbuffers
// do not point to the builder buffer overriding others info.
// Take a reference of the inner buffer.
const buffer = this.#bufferBuilder.asUint8Array();

// Clear the buffer builder so it's reused for the next request.
// NOTE: This merely resets the buffer offset, it does not clear the content.
this.#bufferBuilder.clear();

if (buffer.byteLength > MESSAGE_MAX_LEN) {
Expand Down

0 comments on commit 9f24c50

Please sign in to comment.