Skip to content

Commit

Permalink
Merge pull request #48 from DevCycleHQ/read-buffer-directly
Browse files Browse the repository at this point in the history
read buffer directly when parsing string
  • Loading branch information
piotr-oles committed Mar 24, 2023
2 parents 2dd25eb + ac4baf5 commit 78b734c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/as-proto/assembly/internal/FixedReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export class FixedReader extends Reader {
}

string(): string {
const bytes = this.bytes();
return String.UTF8.decodeUnsafe(bytes.dataStart, bytes.byteLength);
const length = this.uint32();
return String.UTF8.decodeUnsafe(this.inc(length), length);
}

skip(length: u32): void {
Expand Down

0 comments on commit 78b734c

Please sign in to comment.