Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;

namespace System.Net.Http.Headers
Expand Down Expand Up @@ -285,6 +286,7 @@ private static bool TryReadUnknownPercentEncodedAlpnProtocolName(ReadOnlySpan<ch
/// <summary>
/// Reads a hex nibble. Specialized for ALPN protocol names as they explicitly can not contain lower-case hex.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static bool TryReadAlpnHexDigit(char ch, out int nibble)
{
int result = HexConverter.FromUpperChar(ch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Runtime.CompilerServices;

namespace System.Net.NetworkInformation
{
Expand Down Expand Up @@ -385,6 +386,7 @@ private static IPAddress ParseIPv6HexString(ReadOnlySpan<char> hexAddress, bool
return ipAddress;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static byte HexToByte(char val)
{
int result = HexConverter.FromChar(val);
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.Uri/src/System/Uri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Private.Uri/src/System/UriHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;

namespace System
Expand Down Expand Up @@ -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.
/// <para>If either char is not hex, returns <see cref="Uri.c_DummyChar"/>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static char DecodeHexChars(int first, int second)
{
int a = HexConverter.FromChar(first);
Expand Down
Loading