Skip to content

Conversation

@pl752
Copy link

@pl752 pl752 commented Dec 11, 2025

I don't think that was how you intended to calculate offset there (the i starts with offset and is then added with offset again, also it performs byte writing count-offset times, it didn't cause any troubles yet as the offset is always passed as 0 on all call sites)

@pl752 pl752 changed the title (Potential bug) wrong offset calculation (Potential FUTURE bug) wrong offset calculation Dec 12, 2025
public void Write(byte[] buffer, int offset, int count)
{
for (var i = offset; i < count; i++)
for (int i = 0; i < count; i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep var here.

public ValueTask WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default)
{
for (var i = offset; i < count; i++)
for (int i = 0; i < count; i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep var here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants