Skip to content

Commit

Permalink
#371 Standardize use of "is" keyword.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstone committed Dec 1, 2020
1 parent 06c1fcc commit aeebee4
Show file tree
Hide file tree
Showing 73 changed files with 1,208 additions and 173 deletions.
1 change: 1 addition & 0 deletions en-US_User.dic
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ pre
prefixdelimiter
prefixtoken
prefixword
prepended
prerelease
psake
quantized
Expand Down
4 changes: 2 additions & 2 deletions src/RapidField.SolidInstruments.Collections/BinaryTreeNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private BinaryTreeNode(T value, BinaryTreeNode<T> leftChild, BinaryTreeNode<T> r
{
if (leftChild is not null)
{
if (AddChild(leftChild) == false)
if (AddChild(leftChild) is false)
{
throw new ArgumentException("The specified left child is invalid.", nameof(leftChild));
}
Expand All @@ -132,7 +132,7 @@ private BinaryTreeNode(T value, BinaryTreeNode<T> leftChild, BinaryTreeNode<T> r

if (rightChild is not null)
{
if (AddChild(rightChild) == false)
if (AddChild(rightChild) is false)
{
throw new ArgumentException("The specified right child is invalid.", nameof(rightChild));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void Write(T element)
/// </exception>
public void Write(T element, Boolean permitOverwrite)
{
if (permitOverwrite == false && Length == Capacity)
if (permitOverwrite is false && Length == Capacity)
{
throw new InvalidOperationException("A write operation failed because it would have overwritten an unread element in the buffer.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void TraverseDown<T>(this ITreeNode<T> target, Action<ITreeNode<T>
action.RejectIf().IsNull(nameof(action));
predicate.RejectIf().IsNull(nameof(predicate));

if (predicate(target) == false)
if (predicate(target) is false)
{
return;
}
Expand Down Expand Up @@ -120,7 +120,7 @@ public static TResult TraverseDown<T, TResult>(this ITreeNode<T> target, Func<IT
function.RejectIf().IsNull(nameof(function));
predicate.RejectIf().IsNull(nameof(predicate));

if (predicate(target) == false)
if (predicate(target) is false)
{
return default;
}
Expand Down Expand Up @@ -176,7 +176,7 @@ public static void TraverseUp<T>(this ITreeNode<T> target, Action<ITreeNode<T>>
action.RejectIf().IsNull(nameof(action));
predicate.RejectIf().IsNull(nameof(predicate));

if (predicate(target) == false)
if (predicate(target) is false)
{
return;
}
Expand Down Expand Up @@ -244,7 +244,7 @@ public static TResult TraverseUp<T, TResult>(this ITreeNode<T> target, Func<ITre
function.RejectIf().IsNull(nameof(function));
predicate.RejectIf().IsNull(nameof(predicate));

if (predicate(target) == false)
if (predicate(target) is false)
{
return default;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ protected override void Dispose(Boolean disposing)
{
try
{
if (IsDisposed == false && OverwriteWithZerosOnDispose)
if (IsDisposed is false && OverwriteWithZerosOnDispose)
{
OverwriteWithZeros(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ protected override void Dispose(Boolean disposing)
{
try
{
if (IsDisposed == false)
if (IsDisposed is false)
{
if (HandleIsActive)
{
Expand Down
6 changes: 3 additions & 3 deletions src/RapidField.SolidInstruments.Collections/TreeNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public TreeNode(T value, IEnumerable<TChildNode> children)
/// </exception>
public void Destroy()
{
if (IsRoot == false)
if (IsRoot is false)
{
((TreeNode<T>)Parent).RemoveChild(this);
}
Expand Down Expand Up @@ -200,7 +200,7 @@ public TreeNode(T value, IEnumerable<TreeNode<T>> children)
{
throw new ArgumentException("The specified collection contains a null node.", nameof(children));
}
else if (AddChild(node, true) == false)
else if (AddChild(node, true) is false)
{
throw new ArgumentException("The specified collection contains a duplicate or invalid node.", nameof(children));
}
Expand Down Expand Up @@ -340,7 +340,7 @@ public IEnumerable<ITreeNode<T>> Children
/// <remarks>
/// When true, <see cref="Children" /> is an empty collection.
/// </remarks>
public Boolean IsLeaf => ChildrenReference.Any() == false;
public Boolean IsLeaf => ChildrenReference.Any() is false;

/// <summary>
/// Gets a value indicating whether or not the current <see cref="TreeNode{T}" /> is a root node (a node without a parent).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected sealed override void Configure(ContainerBuilder configurator, IConfigu
/// Gets the collection of non-abstract public class types defined by <see cref="TargetAssembly" /> that are registered by
/// the current <see cref="AutofacCommandHandlerModule{TBaseCommandHandler}" />.
/// </summary>
public IEnumerable<Type> MatchedTypes => TargetAssembly.GetTypes().Where(type => type.IsPublic && type.IsClass && type.IsAbstract == false && BaseCommandHandlerType.IsAssignableFrom(type));
public IEnumerable<Type> MatchedTypes => TargetAssembly.GetTypes().Where(type => type.IsPublic && type.IsClass && type.IsAbstract is false && BaseCommandHandlerType.IsAssignableFrom(type));

/// <summary>
/// Gets the assembly from which command handler types are registered by the current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected sealed override void Configure(ServiceCollection configurator, IConfig
/// Gets the collection of non-abstract public class types defined by <see cref="TargetAssembly" /> that are registered by
/// the current <see cref="DotNetNativeCommandHandlerModule{TBaseCommandHandler}" />.
/// </summary>
public IEnumerable<Type> MatchedTypes => TargetAssembly.GetTypes().Where(type => type.IsPublic && type.IsClass && type.IsAbstract == false && BaseCommandHandlerType.IsAssignableFrom(type));
public IEnumerable<Type> MatchedTypes => TargetAssembly.GetTypes().Where(type => type.IsPublic && type.IsClass && type.IsAbstract is false && BaseCommandHandlerType.IsAssignableFrom(type));

/// <summary>
/// Gets the assembly from which command handler types are registered by the current
Expand Down
4 changes: 2 additions & 2 deletions src/RapidField.SolidInstruments.Command/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Guid CorrelationIdentifier
{
get
{
if (CorrelationIdentifierField.HasValue == false)
if (CorrelationIdentifierField.HasValue is false)
{
CorrelationIdentifierField = Guid.NewGuid();
}
Expand Down Expand Up @@ -143,7 +143,7 @@ public Guid CorrelationIdentifier
{
get
{
if (CorrelationIdentifierField.HasValue == false)
if (CorrelationIdentifierField.HasValue is false)
{
CorrelationIdentifierField = Guid.NewGuid();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ public static class ValidationTargetIEnumerableExtensions
internal static ValidationResult<TArgument> RejectIfIsNullOrEmpty<TArgument, T>(this ValidationTarget<TArgument> target, String targetParameterName)
where TArgument : IEnumerable<T>
{
if (target.Argument == null)
if (target.Argument is null)
{
throw new ArgumentNullException(targetParameterName);
}
else if (target.Argument.Any() == false)
else if (target.Argument.Any() is false)
{
throw new ArgumentEmptyException(targetParameterName);
}
Expand Down
Loading

0 comments on commit aeebee4

Please sign in to comment.