Skip to content

Commit 8f99f29

Browse files
committed
Step through.
1 parent a6c120d commit 8f99f29

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Util/Extensions.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ namespace ReClassNET.Util
1111
public static class Extensions
1212
{
1313
[Pure]
14+
[DebuggerStepThrough]
1415
public static int ToRgb(this Color color)
1516
{
1617
return 0xFFFFFF & color.ToArgb();
1718
}
1819

1920
[Pure]
21+
[DebuggerStepThrough]
2022
public static void FillWithZero(this byte[] b)
2123
{
2224
Contract.Requires(b != null);
@@ -28,6 +30,7 @@ public static void FillWithZero(this byte[] b)
2830
}
2931

3032
[Pure]
33+
[DebuggerStepThrough]
3134
public static Point OffsetEx(this Point p, int x, int y)
3235
{
3336
var temp = p;
@@ -60,12 +63,14 @@ public static IEnumerable<BaseNode> Descendants(this BaseNode root)
6063
#region Pointer
6164

6265
[Pure]
66+
[DebuggerStepThrough]
6367
public static bool IsNull(this IntPtr ptr)
6468
{
6569
return ptr == IntPtr.Zero;
6670
}
6771

6872
[Pure]
73+
[DebuggerStepThrough]
6974
public static bool MayBeValid(this IntPtr ptr)
7075
{
7176
#if WIN64
@@ -76,6 +81,7 @@ public static bool MayBeValid(this IntPtr ptr)
7681
}
7782

7883
[Pure]
84+
[DebuggerStepThrough]
7985
public static IntPtr Add(this IntPtr lhs, IntPtr rhs)
8086
{
8187
#if WIN64
@@ -86,6 +92,7 @@ public static IntPtr Add(this IntPtr lhs, IntPtr rhs)
8692
}
8793

8894
[Pure]
95+
[DebuggerStepThrough]
8996
public static IntPtr Sub(this IntPtr lhs, IntPtr rhs)
9097
{
9198
#if WIN64
@@ -96,6 +103,7 @@ public static IntPtr Sub(this IntPtr lhs, IntPtr rhs)
96103
}
97104

98105
[Pure]
106+
[DebuggerStepThrough]
99107
public static IntPtr Mul(this IntPtr lhs, IntPtr rhs)
100108
{
101109
#if WIN64
@@ -106,6 +114,7 @@ public static IntPtr Mul(this IntPtr lhs, IntPtr rhs)
106114
}
107115

108116
[Pure]
117+
[DebuggerStepThrough]
109118
public static IntPtr Div(this IntPtr lhs, IntPtr rhs)
110119
{
111120
Contract.Requires(!rhs.IsNull());
@@ -118,6 +127,7 @@ public static IntPtr Div(this IntPtr lhs, IntPtr rhs)
118127
}
119128

120129
[Pure]
130+
[DebuggerStepThrough]
121131
public static bool InRange(this IntPtr address, IntPtr start, IntPtr end)
122132
{
123133
#if WIN64
@@ -130,6 +140,7 @@ public static bool InRange(this IntPtr address, IntPtr start, IntPtr end)
130140
}
131141

132142
[Pure]
143+
[DebuggerStepThrough]
133144
public static int CompareTo(this IntPtr lhs, IntPtr rhs)
134145
{
135146
#if WIN64
@@ -140,6 +151,7 @@ public static int CompareTo(this IntPtr lhs, IntPtr rhs)
140151
}
141152

142153
[Pure]
154+
[DebuggerStepThrough]
143155
public static int CompareToRange(this IntPtr address, IntPtr start, IntPtr end)
144156
{
145157
if (InRange(address, start, end))
@@ -154,18 +166,21 @@ public static int CompareToRange(this IntPtr address, IntPtr start, IntPtr end)
154166
#region String
155167

156168
[Pure]
169+
[DebuggerStepThrough]
157170
public static bool IsPrintable(this char c)
158171
{
159172
return ' ' <= c && c <= '~';
160173
}
161174

175+
[DebuggerStepThrough]
162176
public static IEnumerable<char> InterpretAsUTF8(this IEnumerable<byte> source)
163177
{
164178
Contract.Requires(source != null);
165179

166180
return source.Select(b => (char)b);
167181
}
168182

183+
[DebuggerStepThrough]
169184
public static IEnumerable<char> InterpretAsUTF16(this IEnumerable<byte> source)
170185
{
171186
Contract.Requires(source != null);
@@ -176,13 +191,15 @@ public static IEnumerable<char> InterpretAsUTF16(this IEnumerable<byte> source)
176191
return chars;
177192
}
178193

194+
[DebuggerStepThrough]
179195
public static bool IsPrintableData(this IEnumerable<char> source)
180196
{
181197
Contract.Requires(source != null);
182198

183199
return IsLikelyPrintableData(source) >= 1.0f;
184200
}
185201

202+
[DebuggerStepThrough]
186203
public static float IsLikelyPrintableData(this IEnumerable<char> source)
187204
{
188205
Contract.Requires(source != null);
@@ -212,6 +229,7 @@ public static float IsLikelyPrintableData(this IEnumerable<char> source)
212229
}
213230

214231
[Pure]
232+
[DebuggerStepThrough]
215233
public static string LimitLength(this string s, int length)
216234
{
217235
Contract.Requires(s != null);
@@ -229,12 +247,14 @@ public static string LimitLength(this string s, int length)
229247
#region Floating Point
230248

231249
[Pure]
250+
[DebuggerStepThrough]
232251
public static bool IsNearlyEqual(this float val, float other)
233252
{
234253
return IsNearlyEqual(val, other, float.Epsilon);
235254
}
236255

237256
[Pure]
257+
[DebuggerStepThrough]
238258
public static bool IsNearlyEqual(this float val, float other, float epsilon)
239259
{
240260
var diff = Math.Abs(val - other);
@@ -254,12 +274,14 @@ public static bool IsNearlyEqual(this float val, float other, float epsilon)
254274
}
255275

256276
[Pure]
277+
[DebuggerStepThrough]
257278
public static bool IsNearlyEqual(this double val, double other)
258279
{
259280
return IsNearlyEqual(val, other, double.Epsilon);
260281
}
261282

262283
[Pure]
284+
[DebuggerStepThrough]
263285
public static bool IsNearlyEqual(this double val, double other, double epsilon)
264286
{
265287
var diff = Math.Abs(val - other);
@@ -282,6 +304,7 @@ public static bool IsNearlyEqual(this double val, double other, double epsilon)
282304

283305
#region List
284306

307+
[DebuggerStepThrough]
285308
public static T BinaryFind<T>(this IList<T> source, Func<T, int> comparer)
286309
{
287310
Contract.Requires(source != null);
@@ -450,6 +473,7 @@ public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TS
450473
}
451474
}
452475

476+
[DebuggerStepThrough]
453477
public static bool SequenceEqualsEx<T>(this IEnumerable<T> first, IEnumerable<T> second)
454478
{
455479
Contract.Requires(first != null);
@@ -458,13 +482,14 @@ public static bool SequenceEqualsEx<T>(this IEnumerable<T> first, IEnumerable<T>
458482
return SequenceEqualsEx(first, second, EqualityComparer<T>.Default);
459483
}
460484

461-
public static bool SequenceEqualsEx<T>(this IEnumerable<T> first, IEnumerable<T> second, IEqualityComparer<T> comparer)
485+
[DebuggerStepThrough]
486+
public static bool SequenceEqualsEx<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
462487
{
463488
Contract.Requires(first != null);
464489
Contract.Requires(second != null);
465490
Contract.Requires(comparer != null);
466491

467-
var counter = new Dictionary<T, int>(comparer);
492+
var counter = new Dictionary<TSource, int>(comparer);
468493
foreach (var element in first)
469494
{
470495
if (counter.ContainsKey(element))

0 commit comments

Comments
 (0)