@@ -215,7 +215,7 @@ internal void AppendSqlString(ByteBufferWriter writer, StatementPreparerOptions
215
215
216
216
if ( Value is null || Value == DBNull . Value )
217
217
{
218
- writer . Write ( s_nullBytes ) ;
218
+ writer . Write ( NullBytes ) ;
219
219
}
220
220
else if ( Value is string stringValue )
221
221
{
@@ -288,16 +288,16 @@ internal void AppendSqlString(ByteBufferWriter writer, StatementPreparerOptions
288
288
( ( ReadOnlyMemory < byte > ) Value ) . Span ;
289
289
290
290
// determine the number of bytes to be written
291
- var length = inputSpan . Length + s_binaryBytes . Length + 1 ;
291
+ var length = inputSpan . Length + BinaryBytes . Length + 1 ;
292
292
foreach ( var by in inputSpan )
293
293
{
294
294
if ( by == 0x27 || by == 0x5C )
295
295
length ++ ;
296
296
}
297
297
298
298
var outputSpan = writer . GetSpan ( length ) ;
299
- s_binaryBytes . CopyTo ( outputSpan ) ;
300
- var index = s_binaryBytes . Length ;
299
+ BinaryBytes . CopyTo ( outputSpan ) ;
300
+ var index = BinaryBytes . Length ;
301
301
foreach ( var by in inputSpan )
302
302
{
303
303
if ( by == 0x27 || by == 0x5C )
@@ -310,7 +310,7 @@ internal void AppendSqlString(ByteBufferWriter writer, StatementPreparerOptions
310
310
}
311
311
else if ( Value is bool boolValue )
312
312
{
313
- writer . Write ( boolValue ? s_trueBytes : s_falseBytes ) ;
313
+ writer . Write ( boolValue ? TrueBytes : FalseBytes ) ;
314
314
}
315
315
else if ( Value is float || Value is double )
316
316
{
@@ -373,7 +373,7 @@ internal void AppendSqlString(ByteBufferWriter writer, StatementPreparerOptions
373
373
Utility . SwapBytes ( bytes , 1 , 3 ) ;
374
374
}
375
375
}
376
- writer . Write ( s_binaryBytes ) ;
376
+ writer . Write ( BinaryBytes ) ;
377
377
foreach ( var by in bytes )
378
378
{
379
379
if ( by == 0x27 || by == 0x5C )
@@ -682,10 +682,10 @@ private static void WriteTime(ByteBufferWriter writer, TimeSpan timeSpan)
682
682
}
683
683
}
684
684
685
- static readonly byte [ ] s_nullBytes = { 0x4E , 0x55 , 0x4C , 0x4C } ; // NULL
686
- static readonly byte [ ] s_trueBytes = { 0x74 , 0x72 , 0x75 , 0x65 } ; // true
687
- static readonly byte [ ] s_falseBytes = { 0x66 , 0x61 , 0x6C , 0x73 , 0x65 } ; // false
688
- static readonly byte [ ] s_binaryBytes = { 0x5F , 0x62 , 0x69 , 0x6E , 0x61 , 0x72 , 0x79 , 0x27 } ; // _binary'
685
+ static ReadOnlySpan < byte > NullBytes => new byte [ ] { 0x4E , 0x55 , 0x4C , 0x4C } ; // NULL
686
+ static ReadOnlySpan < byte > TrueBytes => new byte [ ] { 0x74 , 0x72 , 0x75 , 0x65 } ; // true
687
+ static ReadOnlySpan < byte > FalseBytes => new byte [ ] { 0x66 , 0x61 , 0x6C , 0x73 , 0x65 } ; // false
688
+ static ReadOnlySpan < byte > BinaryBytes => new byte [ ] { 0x5F , 0x62 , 0x69 , 0x6E , 0x61 , 0x72 , 0x79 , 0x27 } ; // _binary'
689
689
690
690
DbType m_dbType ;
691
691
MySqlDbType m_mySqlDbType ;
0 commit comments