Remove usage of [AggressiveOptimization] (#58253)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 1 Sep 2021 13:37:13 +0000 (09:37 -0400)
committerGitHub <noreply@github.com>
Wed, 1 Sep 2021 13:37:13 +0000 (09:37 -0400)
Co-authored-by: Steve Harter <steveharter@users.noreply.github.com>
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectDefaultConverter.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs

index 60708ae..c12debe 100644 (file)
@@ -16,9 +16,6 @@ namespace System.Text.Json.Serialization.Converters
     {
         internal override bool CanHaveIdMetadata => true;
 
-#if NET6_0_OR_GREATER
-        [MethodImpl(MethodImplOptions.AggressiveOptimization)]
-#endif
         internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, [MaybeNullWhen(false)] out T value)
         {
             JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo;
@@ -249,9 +246,6 @@ namespace System.Text.Json.Serialization.Converters
             return true;
         }
 
-#if NET6_0_OR_GREATER
-        [MethodImpl(MethodImplOptions.AggressiveOptimization)]
-#endif
         internal sealed override bool OnTryWrite(
             Utf8JsonWriter writer,
             T value,
index e152005..497c380 100644 (file)
@@ -144,9 +144,6 @@ namespace System.Text.Json.Serialization
         /// <remarks>Note that the value of <seealso cref="HandleNull"/> determines if the converter handles null JSON tokens.</remarks>
         public abstract T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
 
-#if NET6_0_OR_GREATER
-        [MethodImpl(MethodImplOptions.AggressiveOptimization)]
-#endif
         internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T? value)
         {
             if (ConverterStrategy == ConverterStrategy.Value)
@@ -320,9 +317,6 @@ namespace System.Text.Json.Serialization
         /// </summary>
         private static bool IsNull(T value) => value is null;
 
-#if NET6_0_OR_GREATER
-        [MethodImpl(MethodImplOptions.AggressiveOptimization)]
-#endif
         internal bool TryWrite(Utf8JsonWriter writer, in T value, JsonSerializerOptions options, ref WriteStack state)
         {
             if (writer.CurrentDepth >= options.EffectiveMaxDepth)