diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs index 25d32b1620c374..a00725d20c811f 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Text; namespace System.Net.Http.Headers @@ -285,6 +286,7 @@ private static bool TryReadUnknownPercentEncodedAlpnProtocolName(ReadOnlySpan /// Reads a hex nibble. Specialized for ALPN protocol names as they explicitly can not contain lower-case hex. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static bool TryReadAlpnHexDigit(char ch, out int nibble) { int result = HexConverter.FromUpperChar(ch); diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Connections.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Connections.cs index 248ce38b5d2027..d45d8619753b1a 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Connections.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Connections.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Globalization; using System.IO; +using System.Runtime.CompilerServices; namespace System.Net.NetworkInformation { @@ -385,6 +386,7 @@ private static IPAddress ParseIPv6HexString(ReadOnlySpan hexAddress, bool return ipAddress; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static byte HexToByte(char val) { int result = HexConverter.FromChar(val); diff --git a/src/libraries/System.Private.Uri/src/System/Uri.cs b/src/libraries/System.Private.Uri/src/System/Uri.cs index 5418d8d0d5e449..2e694829ea2f73 100644 --- a/src/libraries/System.Private.Uri/src/System/Uri.cs +++ b/src/libraries/System.Private.Uri/src/System/Uri.cs @@ -1515,6 +1515,7 @@ public static bool IsHexDigit(char character) // Throws: // ArgumentException // + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int FromHex(char digit) { int result = HexConverter.FromChar(digit); diff --git a/src/libraries/System.Private.Uri/src/System/UriHelper.cs b/src/libraries/System.Private.Uri/src/System/UriHelper.cs index a1e897873e4f03..eff08e9827f0da 100644 --- a/src/libraries/System.Private.Uri/src/System/UriHelper.cs +++ b/src/libraries/System.Private.Uri/src/System/UriHelper.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Text; namespace System @@ -505,6 +506,7 @@ internal static void PercentEncodeByte(byte b, ref ValueStringBuilder to) /// Converts 2 hex chars to a byte (returned in a char), e.g, "0a" becomes (char)0x0A. /// If either char is not hex, returns . /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static char DecodeHexChars(int first, int second) { int a = HexConverter.FromChar(first);