From cd06130b381cc0d4d6e0efc0e6c3df49329ccdc2 Mon Sep 17 00:00:00 2001 From: Shane32 Date: Tue, 7 May 2024 11:02:56 -0400 Subject: [PATCH] Add comment --- QRCoder/QRCodeGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/QRCoder/QRCodeGenerator.cs b/QRCoder/QRCodeGenerator.cs index b4eb63bc..e004a570 100644 --- a/QRCoder/QRCodeGenerator.cs +++ b/QRCoder/QRCodeGenerator.cs @@ -751,12 +751,13 @@ bool IsUtf8() /// private static bool IsValidISO(string input) { + // No heap allocations if the string is ISO-8859-1 try { _ = _iso88591ExceptionFallback.GetByteCount(input); return true; } - catch (EncoderFallbackException) + catch (EncoderFallbackException) // The exception is a heap allocation and not ideal { return false; }