Skip to content

Commit 6dd85c9

Browse files
committed
remove some unused stuff in Util, fix warnings
1 parent 1aada98 commit 6dd85c9

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

Dalamud/Utility/Util.cs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public static class Util
6565
private static readonly Type GenericSpanType = typeof(Span<>);
6666
private static string? scmVersionInternal;
6767
private static string? gitHashInternal;
68-
private static int? gitCommitCountInternal;
6968
private static string? gitHashClientStructsInternal;
7069

7170
private static ulong moduleStartAddr;
@@ -77,58 +76,6 @@ public static class Util
7776
public static string AssemblyVersion { get; } =
7877
Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString();
7978

80-
/// <summary>
81-
/// Check two byte arrays for equality.
82-
/// </summary>
83-
/// <param name="a1">The first byte array.</param>
84-
/// <param name="a2">The second byte array.</param>
85-
/// <returns>Whether or not the byte arrays are equal.</returns>
86-
public static unsafe bool FastByteArrayCompare(byte[]? a1, byte[]? a2)
87-
{
88-
// Copyright (c) 2008-2013 Hafthor Stefansson
89-
// Distributed under the MIT/X11 software license
90-
// Ref: http://www.opensource.org/licenses/mit-license.php.
91-
// https://stackoverflow.com/a/8808245
92-
93-
if (a1 == a2) return true;
94-
if (a1 == null || a2 == null || a1.Length != a2.Length)
95-
return false;
96-
fixed (byte* p1 = a1, p2 = a2)
97-
{
98-
byte* x1 = p1, x2 = p2;
99-
var l = a1.Length;
100-
for (var i = 0; i < l / 8; i++, x1 += 8, x2 += 8)
101-
{
102-
if (*((long*)x1) != *((long*)x2))
103-
return false;
104-
}
105-
106-
if ((l & 4) != 0)
107-
{
108-
if (*((int*)x1) != *((int*)x2))
109-
return false;
110-
x1 += 4;
111-
x2 += 4;
112-
}
113-
114-
if ((l & 2) != 0)
115-
{
116-
if (*((short*)x1) != *((short*)x2))
117-
return false;
118-
x1 += 2;
119-
x2 += 2;
120-
}
121-
122-
if ((l & 1) != 0)
123-
{
124-
if (*((byte*)x1) != *((byte*)x2))
125-
return false;
126-
}
127-
128-
return true;
129-
}
130-
}
131-
13279
/// <summary>
13380
/// Gets the SCM Version from the assembly, or null if it cannot be found. This method will generally return
13481
/// the <c>git describe</c> output for this build, which will be a raw version if this is a stable build or an

0 commit comments

Comments
 (0)