Skip to content

Commit 5db519d

Browse files
committed
Avoid unnecessary pass through the loop.
Signed-off-by: Bradley Grainger <[email protected]>
1 parent e9811b5 commit 5db519d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MySqlConnector/Core/SingleCommandPayloadCreator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public async ValueTask SendCommandPrologueAsync(MySqlConnection connection, Comm
6868
else
6969
bytesRead = await stream.ReadAsync(buffer, packetHeaderLength + totalBytesRead, sizeToRead, cancellationToken).ConfigureAwait(false);
7070
totalBytesRead += bytesRead;
71-
} while (bytesRead > 0);
71+
} while (bytesRead > 0 && totalBytesRead < maxDataSize);
7272
#endif
7373

7474
if (totalBytesRead == 0)

0 commit comments

Comments
 (0)