codebude / QRCoder

A pure C# Open Source QR Code implementation
MIT License
4.43k stars 1.08k forks source link

Refactor compatibility extension methods #534

Closed Shane32 closed 1 month ago

Shane32 commented 1 month ago

Summary

Refactors the Stream.CopyTo method into a polyfill for .NET 3.5 only, and has IsNullOrWhiteSpace inline to the native implementation for available platforms. These methods are internal and the changes will not affect operation.

In addition, ReverseString and IsAllDigit methods were removed as they were not referenced within the codebase.

Test Plan

Existing tests cover both .NET 3.5 and other platforms, ensuring compatibility. The changed and removed methods are not publicly accessible.

Shane32 commented 1 month ago

Certainly. I’ll double check and see. I know the native method is not an extension method. So we can’t just polyfill it like CopyTo. But we could alter the name slightly if nothing else. I’ll check.

Shane32 commented 1 month ago

@codebude Looks like it works as anticipated !