11#region
22
33using System ;
4- #if NETSTANDARD2_1_OR_GREATER || NET8_0_OR_GREATER
4+ #if ! NETSTANDARD2_0
55using System . Buffers ;
66#endif
77using System . Collections ;
@@ -351,7 +351,7 @@ private object DecodeMapToType(
351351 {
352352 var constructor = _typeAcivatorCreator . GetActivator ( expectedType ) ;
353353
354- #if NETSTANDARD2_1_OR_GREATER || NET8_0_OR_GREATER
354+ #if ! NETSTANDARD2_0
355355 // N.B. Rent can return a larger arrays. This is fine because constructors allow arrays larger than the
356356 // number of parameters.
357357 object ? [ ] parameters = ArrayPool < object ? > . Shared . Rent ( constructor . DefaultParameters . Length ) ;
@@ -383,7 +383,7 @@ private object DecodeMapToType(
383383 outOffset = offset ;
384384 object obj = constructor . Activator ( parameters ) ;
385385
386- #if NETSTANDARD2_1_OR_GREATER || NET8_0_OR_GREATER
386+ #if ! NETSTANDARD2_0
387387 ArrayPool < object ? > . Shared . Return ( parameters ) ;
388388#endif
389389
@@ -403,7 +403,7 @@ private void SetAlwaysCreatedParams(
403403
404404 var activator = _typeAcivatorCreator . GetActivator ( param . ParameterType ) ;
405405
406- #if NETSTANDARD2_1_OR_GREATER || NET8_0_OR_GREATER
406+ #if ! NETSTANDARD2_0
407407 object ? [ ] cstorParams = ArrayPool < object ? > . Shared . Rent ( activator . DefaultParameters . Length ) ;
408408#else
409409 object ? [ ] cstorParams = new object ? [ activator . DefaultParameters . Length ] ;
@@ -415,7 +415,7 @@ private void SetAlwaysCreatedParams(
415415 SetAlwaysCreatedParams ( activator , cstorParams , injectables , network ) ;
416416 parameters [ param . Position ] = activator . Activator ( cstorParams ) ;
417417
418- #if NETSTANDARD2_1_OR_GREATER || NET8_0_OR_GREATER
418+ #if ! NETSTANDARD2_0
419419 ArrayPool < object ? > . Shared . Return ( cstorParams ) ;
420420#endif
421421 }
0 commit comments