Conversation
Contributor
📝 WalkthroughWalkthroughThe WriteScanlines method in QRCoder/PngByteQRCode.cs removes a .NET 3.5 conditional branch and always writes compressed IDAT data using idatStream.WriteTo(_stream), eliminating CopyTo usage and idatStream.Position resets. No public APIs were changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant W as WriteScanlines
participant D as DeflateStream
participant I as idatStream (MemoryStream)
participant S as _stream (output)
Note over W,I: Old flow (pre-change)
W->>D: Compress scanlines into IDAT
D-->>I: Write compressed bytes
W->>I: Reset Position = 0
alt NET35
W->>S: I.WriteTo(S)
else non-NET35
W->>S: I.CopyTo(S)
end
sequenceDiagram
autonumber
participant W as WriteScanlines
participant D as DeflateStream
participant I as idatStream (MemoryStream)
participant S as _stream (output)
rect rgba(220,240,255,0.5)
Note over W,I: New flow (post-change)
end
W->>D: Compress scanlines into IDAT
D-->>I: Write compressed bytes
Note over W,I: No Position reset
W->>S: I.WriteTo(S)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Shane32
commented
Oct 1, 2025
| // Compressed data. | ||
| idatStream.Position = 0; | ||
| #if NET35 | ||
| idatStream.WriteTo(_stream); |
Owner
Author
There was a problem hiding this comment.
WriteTo writes the entire MemoryStream (disregarding position) to the target stream, and is a supported method across all .NET variations.
gfoidl
approved these changes
Oct 1, 2025
This was referenced Oct 9, 2025
This was referenced Nov 25, 2025
This was referenced Dec 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit