Skip to content

Commit d1c61a7

Browse files
committed
Consolidated bool and pad reading into single read
1 parent c5fadc8 commit d1c61a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/FirebirdSql.Data.FirebirdClient/Client/Managed/XdrReaderWriter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,13 @@ public async ValueTask<decimal> ReadDecimalAsync(int type, int scale, Cancellati
446446

447447
public bool ReadBoolean()
448448
{
449-
Span<byte> bytes = stackalloc byte[1];
450-
ReadOpaque(bytes, 1);
449+
Span<byte> bytes = stackalloc byte[4];
450+
ReadBytes(bytes, 4);
451451
return TypeDecoder.DecodeBoolean(bytes);
452452
}
453453
public async ValueTask<bool> ReadBooleanAsync(CancellationToken cancellationToken = default)
454454
{
455-
await ReadOpaqueAsync(_boolbuffer, 1, cancellationToken).ConfigureAwait(false);
455+
await ReadBytesAsync(_boolbuffer, 4, cancellationToken).ConfigureAwait(false);
456456
return TypeDecoder.DecodeBoolean(_boolbuffer);
457457
}
458458

0 commit comments

Comments
 (0)