Skip to content

Commit

Permalink
fixed confusing naming
Browse files Browse the repository at this point in the history
  • Loading branch information
reczkok committed Oct 22, 2024
1 parent d03fd70 commit 4ed5962
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/typed-binary/src/io/bufferIOBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class BufferIOBase {
protected readonly uint8View: Uint8Array;
protected readonly helperInt32View: Int32Array;
protected readonly helperUint32View: Uint32Array;
protected readonly helperFloat16View: Uint16Array;
protected readonly helperUint16View: Uint16Array;
protected readonly helperFloat32View: Float32Array;
protected readonly helperByteView: Uint8Array;
protected readonly switchEndianness: boolean;
Expand Down Expand Up @@ -46,7 +46,7 @@ export class BufferIOBase {
this.helperUint32View = new Uint32Array(helperBuffer);
this.helperFloat32View = new Float32Array(helperBuffer);
this.helperByteView = new Uint8Array(helperBuffer);
this.helperFloat16View = new Uint16Array(helperBuffer);
this.helperUint16View = new Uint16Array(helperBuffer);
}

get currentByteOffset() {
Expand Down
2 changes: 1 addition & 1 deletion packages/typed-binary/src/io/bufferReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class BufferReader extends BufferIOBase implements ISerialInput {
readFloat16() {
this.copyInputToHelper(2);

return float16ToNumber(this.helperFloat16View);
return float16ToNumber(this.helperUint16View);
}

readFloat32() {
Expand Down
2 changes: 1 addition & 1 deletion packages/typed-binary/src/io/bufferWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class BufferWriter extends BufferIOBase implements ISerialOutput {
}

writeFloat16(value: number): void {
this.helperFloat16View[0] = numberToFloat16(value)[0];
this.helperUint16View[0] = numberToFloat16(value)[0];

this.copyHelperToOutput(2);
}
Expand Down

0 comments on commit 4ed5962

Please sign in to comment.