Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods in Simplifier.cs that only access read-only members were made readonly #615

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Sources/AngouriMath/AngouriMath/Functions/Boolean/Simplifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ private protected static IEnumerable<Entity> LinearChildren<TNode, TGetter>(Enti

partial record Orf
{
private struct OrfBranchGetter : IBranchGetter<Orf> { public Entity Left(Orf node) => node.Left; public Entity Right(Orf node) => node.Right; }
private struct OrfBranchGetter : IBranchGetter<Orf> { public readonly Entity Left(Orf node) => node.Left; public readonly Entity Right(Orf node) => node.Right; }
internal static IEnumerable<Entity> LinearChildren(Entity expr)
=> LinearChildren<Orf, OrfBranchGetter>(expr);
}

partial record Andf
{
private struct AndfBranchGetter : IBranchGetter<Andf> { public Entity Left(Andf node) => node.Left; public Entity Right(Andf node) => node.Right; }
private struct AndfBranchGetter : IBranchGetter<Andf> { public readonly Entity Left(Andf node) => node.Left; public readonly Entity Right(Andf node) => node.Right; }
internal static IEnumerable<Entity> LinearChildren(Entity expr)
=> LinearChildren<Andf, AndfBranchGetter>(expr);
}

partial record Xorf
{
private struct XorfBranchGetter : IBranchGetter<Xorf> { public Entity Left(Xorf node) => node.Left; public Entity Right(Xorf node) => node.Right; }
private struct XorfBranchGetter : IBranchGetter<Xorf> { public readonly Entity Left(Xorf node) => node.Left; public readonly Entity Right(Xorf node) => node.Right; }
internal static IEnumerable<Entity> LinearChildren(Entity expr)
=> LinearChildren<Xorf, XorfBranchGetter>(expr);

Expand All @@ -52,14 +52,14 @@ partial record Set
{
partial record Unionf
{
private struct UnionfBranchGetter : IBranchGetter<Unionf> { public Entity Left(Unionf node) => node.Left; public Entity Right(Unionf node) => node.Right; }
private struct UnionfBranchGetter : IBranchGetter<Unionf> { public readonly Entity Left(Unionf node) => node.Left; public readonly Entity Right(Unionf node) => node.Right; }
internal static IEnumerable<Entity> LinearChildren(Entity expr)
=> LinearChildren<Unionf, UnionfBranchGetter>(expr);
}

partial record Intersectionf
{
private struct IntersectionfBranchGetter : IBranchGetter<Intersectionf> { public Entity Left(Intersectionf node) => node.Left; public Entity Right(Intersectionf node) => node.Right; }
private struct IntersectionfBranchGetter : IBranchGetter<Intersectionf> { public readonly Entity Left(Intersectionf node) => node.Left; public readonly Entity Right(Intersectionf node) => node.Right; }
internal static IEnumerable<Entity> LinearChildren(Entity expr)
=> LinearChildren<Intersectionf, IntersectionfBranchGetter>(expr);
}
Expand Down
Loading