diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index d53828858..7724c68e0 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -65,7 +65,6 @@ public static class Util private static readonly Type GenericSpanType = typeof(Span<>); private static string? scmVersionInternal; private static string? gitHashInternal; - private static int? gitCommitCountInternal; private static string? gitHashClientStructsInternal; private static ulong moduleStartAddr; @@ -77,58 +76,6 @@ public static class Util public static string AssemblyVersion { get; } = Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString(); - /// - /// Check two byte arrays for equality. - /// - /// The first byte array. - /// The second byte array. - /// Whether or not the byte arrays are equal. - public static unsafe bool FastByteArrayCompare(byte[]? a1, byte[]? a2) - { - // Copyright (c) 2008-2013 Hafthor Stefansson - // Distributed under the MIT/X11 software license - // Ref: http://www.opensource.org/licenses/mit-license.php. - // https://stackoverflow.com/a/8808245 - - if (a1 == a2) return true; - if (a1 == null || a2 == null || a1.Length != a2.Length) - return false; - fixed (byte* p1 = a1, p2 = a2) - { - byte* x1 = p1, x2 = p2; - var l = a1.Length; - for (var i = 0; i < l / 8; i++, x1 += 8, x2 += 8) - { - if (*((long*)x1) != *((long*)x2)) - return false; - } - - if ((l & 4) != 0) - { - if (*((int*)x1) != *((int*)x2)) - return false; - x1 += 4; - x2 += 4; - } - - if ((l & 2) != 0) - { - if (*((short*)x1) != *((short*)x2)) - return false; - x1 += 2; - x2 += 2; - } - - if ((l & 1) != 0) - { - if (*((byte*)x1) != *((byte*)x2)) - return false; - } - - return true; - } - } - /// /// Gets the SCM Version from the assembly, or null if it cannot be found. This method will generally return /// the git describe output for this build, which will be a raw version if this is a stable build or an