forked from Unity-Technologies/UnityMixedCallstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFuzzyRangeComparer.cs
More file actions
34 lines (30 loc) · 780 Bytes
/
Copy pathFuzzyRangeComparer.cs
File metadata and controls
34 lines (30 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections.Generic;
namespace UnityMixedCallstack
{
struct Range
{
public ulong Start;
public ulong End;
public string Name;
public string File;
public override string ToString()
{
return $"{File}::{Name} -- IP Range: {Start:X16} -> {End:X16}";
}
}
class FuzzyRangeComparer : IComparer<Range>
{
public int Compare(Range x, Range y)
{
if (x.Name == null && y.Start <= x.Start && y.End >= x.Start)
{
return 0;
}
if (y.Name == null && x.Start <= y.Start && x.End >= y.Start)
{
return 0;
}
return x.Start.CompareTo(y.Start);
}
}
}