File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/MySqlConnector/Utilities Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,11 @@ public static RSAParameters GetRsaParameters(string key)
138138 var keyChars = key . AsSpan ( ) [ keyStartIndex ..keyEndIndex ] ;
139139 var bufferLength = keyChars . Length / 4 * 3 ;
140140 byte [ ] ? buffer = null ;
141- Span < byte > bufferBytes = bufferLength <= 1024 ? stackalloc byte [ bufferLength ] : default ;
141+ scoped Span < byte > bufferBytes ;
142142 if ( bufferLength > 1024 )
143- {
144- buffer = ArrayPool < byte > . Shared . Rent ( bufferLength ) ;
145- bufferBytes = buffer . AsSpan ( ) ;
146- }
143+ bufferBytes = buffer = ArrayPool < byte > . Shared . Rent ( bufferLength ) ;
144+ else
145+ bufferBytes = stackalloc byte [ bufferLength ] ;
147146 try
148147 {
149148 if ( ! System . Convert . TryFromBase64Chars ( keyChars , bufferBytes , out var bytesWritten ) )
You can’t perform that action at this time.
0 commit comments