aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Common/Hex.cs2
-rw-r--r--benches/Jellyfin.Common.Benches/HexDecodeBenches.cs5
-rw-r--r--benches/Jellyfin.Common.Benches/Program.cs2
3 files changed, 6 insertions, 3 deletions
diff --git a/MediaBrowser.Common/Hex.cs b/MediaBrowser.Common/Hex.cs
index 6c86e4e6d..b2d9aea3a 100644
--- a/MediaBrowser.Common/Hex.cs
+++ b/MediaBrowser.Common/Hex.cs
@@ -81,7 +81,7 @@ namespace MediaBrowser.Common
break; // Unreachable
}
- bytes[j] = (byte)((a << 4) | b);
+ bytes[j] = (byte)((a * 16) | b);
}
return bytes;
diff --git a/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs b/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs
index 2efe5273f..5cd47202c 100644
--- a/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs
+++ b/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs
@@ -9,7 +9,7 @@ namespace Jellyfin.Common.Benches
[MemoryDiagnoser]
public class HexDecodeBenches
{
- [Params(0, 10, 100, 1000, 10000, 1000000)]
+ [Params(/*0,*/ 10, 100, 1000, 10000, 1000000)]
public int N { get; set; }
private string data;
@@ -40,6 +40,9 @@ namespace Jellyfin.Common.Benches
public byte[] Decode() => Hex.Decode(data);
[Benchmark]
+ public byte[] Decode2() => Hex.Decode2(data);
+
+ //[Benchmark]
public byte[] DecodeSubString() => DecodeSubString(data);
}
}
diff --git a/benches/Jellyfin.Common.Benches/Program.cs b/benches/Jellyfin.Common.Benches/Program.cs
index b218b0dc1..e7d51c1b5 100644
--- a/benches/Jellyfin.Common.Benches/Program.cs
+++ b/benches/Jellyfin.Common.Benches/Program.cs
@@ -7,7 +7,7 @@ namespace Jellyfin.Common.Benches
{
public static void Main(string[] args)
{
- _ = BenchmarkRunner.Run<HexEncodeBenches>();
+ //_ = BenchmarkRunner.Run<HexEncodeBenches>();
_ = BenchmarkRunner.Run<HexDecodeBenches>();
}
}