Skip to content

Commit db2eb35

Browse files
committed
Cleanup, beta 3 preparation
1 parent 56d00b2 commit db2eb35

11 files changed

Lines changed: 24 additions & 10 deletions

File tree

Build/Props/CodeJam.Default.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AssemblyOriginatorKeyFile>..\Build\CodeJam.snk</AssemblyOriginatorKeyFile>
1111

1212
<Version>3.0.1.0</Version>
13-
<PackageVersion>3.0.1-beta2</PackageVersion>
13+
<PackageVersion>3.0.1-beta3</PackageVersion>
1414
<PackageOutputPath>..\_Results</PackageOutputPath>
1515

1616
<Company>RSDN</Company>

CodeJam.Main/Arithmetic/OperatorsFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ public static Func<T, T, bool> ComparisonOperator<T>(ExpressionType comparisonTy
420420
[NotNull]
421421
private static Func<T, T, bool> GetComparerComparison<T>(ExpressionType comparisonType)
422422
{
423+
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
423424
switch (comparisonType)
424425
{
425426
case ExpressionType.Equal:

CodeJam.Main/Assertions/Code.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#endif
1717

1818
using static CodeJam.Targeting.MethodImplOptionsEx;
19+
// ReSharper disable BuiltInTypeReferenceStyleForMemberAccess
1920

2021
namespace CodeJam
2122
{

CodeJam.Main/Collections/ComparerBuilder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Collections.Generic;
44
using System.Linq;
55
using System.Linq.Expressions;
6-
using System.Reflection;
76

87
using JetBrains.Annotations;
98

CodeJam.Main/EnumHelper.Holder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private static TEnum[] GetNonDefaultUniqueFlagsCore()
101101
static int GetNumberOfSetBits(TEnum value)
102102
{
103103
var i = Convert.ToUInt64(value);
104-
i = i - ((i >> 1) & 0x5555555555555555UL);
104+
i -= (i >> 1) & 0x5555555555555555UL;
105105
i = (i & 0x3333333333333333UL) + ((i >> 2) & 0x3333333333333333UL);
106106
return (int)(unchecked(((i + (i >> 4)) & 0xF0F0F0F0F0F0F0FUL) * 0x101010101010101UL) >> 56);
107107
}

CodeJam.Main/EnumHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public static bool IsDefined<TEnum>([NotNull] string value)
235235
public static bool AreFlagsDefined<TEnum>(TEnum flags)
236236
where TEnum : struct, Enum =>
237237
IsDefined(flags)
238-
|| (MetaHolder<TEnum>.IsFlagsEnum && OpHolder<TEnum>.IsFlagSetCallback(MetaHolder<TEnum>.ValuesMask, flags));
238+
|| MetaHolder<TEnum>.IsFlagsEnum && OpHolder<TEnum>.IsFlagSetCallback(MetaHolder<TEnum>.ValuesMask, flags);
239239

240240
/// <summary>Determines whether all bits of the flags combination are defined.</summary>
241241
/// <typeparam name="TEnum">The type of the enum.</typeparam>

CodeJam.Main/Expressions/ExpressionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private static void VisitInternal([CanBeNull] this Expression expr, [NotNull, In
4545
if (expr == null)
4646
return;
4747

48+
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
4849
switch (expr.NodeType)
4950
{
5051
case ExpressionType.Add:
@@ -323,9 +324,6 @@ void Action(MemberBinding b)
323324
VisitInternal(expr.Reduce(), func);
324325
break;
325326
}
326-
327-
default:
328-
break;
329327
}
330328

331329
func(expr);
@@ -362,6 +360,7 @@ private static void VisitInternal([CanBeNull] this Expression expr, [NotNull, In
362360
if (expr == null || !func(expr))
363361
return;
364362

363+
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
365364
switch (expr.NodeType)
366365
{
367366
case ExpressionType.Add:
@@ -708,6 +707,7 @@ private static Expression FindInternal(this Expression expr, Func<Expression, bo
708707
if (expr == null || func(expr))
709708
return expr;
710709

710+
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
711711
switch (expr.NodeType)
712712
{
713713
case ExpressionType.Add:

CodeJam.Main/Readme.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ What's new in 3.0.1-beta3
55
-------------------------
66
* IsAssignableTo() reflection helper.
77
* Deconstruct methods for arrays, lists and enumerables (to support positional pattern).
8-
* Code cleanup
8+
* !Breaking change!: EnumHelper.GetFlagsMask() replaced with EnumHelper.GetValuesMask() method.
9+
* Algorithms.MinMax(). Math.Min/Max() for any comparable type.
10+
* EnumHelper.GetDefinedFlags(value).
11+
* EnumHelper.ToFlags(value) extension method.
12+
* Code cleanup.
13+
* WaitForCancellationAsync() extension method.
14+
* TimeoutHelper class.
15+
* WithTimeout() methods.
16+
* Refactoring and code cleanup
917

1018
What's new in 3.0.1-beta2
1119
-------------------------

CodeJam.Main/Strings/CharExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#if TARGETS_NET || NETSTANDARD20_OR_GREATER || NETCOREAPP20_OR_GREATER
66
using CharEx = System.Char;
7+
// ReSharper disable BuiltInTypeReferenceStyleForMemberAccess
78
#else
89
using CharEx = System.CharEx;
910
#endif

CodeJam.Main/Targeting/TypeExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public static Attribute[] GetCustomAttributes([NotNull] this Type type, Type att
261261
#endif
262262

263263
[MethodImpl(AggressiveInlining)]
264-
public static object GetCustomAttributeWithInterfaceSupport(
264+
private static object GetCustomAttributeWithInterfaceSupport(
265265
[NotNull] this Type type, Type attributeType, bool inherit)
266266
{
267267
#if TARGETS_NET || NETSTANDARD20_OR_GREATER || NETCOREAPP20_OR_GREATER
@@ -293,7 +293,7 @@ public static T GetCustomAttributeWithInterfaceSupport<T>([NotNull] this Type ty
293293
(T)GetCustomAttributeWithInterfaceSupport(type, typeof(T), inherit);
294294

295295
[MethodImpl(AggressiveInlining)]
296-
public static IEnumerable<Attribute> GetCustomAttributesWithInterfaceSupport(
296+
private static IEnumerable<Attribute> GetCustomAttributesWithInterfaceSupport(
297297
[NotNull] this Type type, Type attributeType, bool inherit)
298298
{
299299
#if TARGETS_NET || NETSTANDARD20_OR_GREATER || NETCOREAPP20_OR_GREATER

0 commit comments

Comments
 (0)