Skip to content

Commit cd06130

Browse files
committed
Add comment
1 parent e08d6e3 commit cd06130

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

QRCoder/QRCodeGenerator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,12 +751,13 @@ bool IsUtf8()
751751
/// </summary>
752752
private static bool IsValidISO(string input)
753753
{
754+
// No heap allocations if the string is ISO-8859-1
754755
try
755756
{
756757
_ = _iso88591ExceptionFallback.GetByteCount(input);
757758
return true;
758759
}
759-
catch (EncoderFallbackException)
760+
catch (EncoderFallbackException) // The exception is a heap allocation and not ideal
760761
{
761762
return false;
762763
}

0 commit comments

Comments
 (0)