From 570525655d2402ca8dd738e3ba14af16318edd17 Mon Sep 17 00:00:00 2001 From: Lehonti Ramos Date: Mon, 4 Sep 2023 20:54:21 +0200 Subject: [PATCH] Methods in `Simplifier.cs` that only access read-only members were made `readonly` --- .../AngouriMath/Functions/Boolean/Simplifier.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/AngouriMath/AngouriMath/Functions/Boolean/Simplifier.cs b/Sources/AngouriMath/AngouriMath/Functions/Boolean/Simplifier.cs index aaccc5a5..4a3228e9 100644 --- a/Sources/AngouriMath/AngouriMath/Functions/Boolean/Simplifier.cs +++ b/Sources/AngouriMath/AngouriMath/Functions/Boolean/Simplifier.cs @@ -28,21 +28,21 @@ private protected static IEnumerable LinearChildren(Enti partial record Orf { - private struct OrfBranchGetter : IBranchGetter { public Entity Left(Orf node) => node.Left; public Entity Right(Orf node) => node.Right; } + private struct OrfBranchGetter : IBranchGetter { public readonly Entity Left(Orf node) => node.Left; public readonly Entity Right(Orf node) => node.Right; } internal static IEnumerable LinearChildren(Entity expr) => LinearChildren(expr); } partial record Andf { - private struct AndfBranchGetter : IBranchGetter { public Entity Left(Andf node) => node.Left; public Entity Right(Andf node) => node.Right; } + private struct AndfBranchGetter : IBranchGetter { public readonly Entity Left(Andf node) => node.Left; public readonly Entity Right(Andf node) => node.Right; } internal static IEnumerable LinearChildren(Entity expr) => LinearChildren(expr); } partial record Xorf { - private struct XorfBranchGetter : IBranchGetter { public Entity Left(Xorf node) => node.Left; public Entity Right(Xorf node) => node.Right; } + private struct XorfBranchGetter : IBranchGetter { public readonly Entity Left(Xorf node) => node.Left; public readonly Entity Right(Xorf node) => node.Right; } internal static IEnumerable LinearChildren(Entity expr) => LinearChildren(expr); @@ -52,14 +52,14 @@ partial record Set { partial record Unionf { - private struct UnionfBranchGetter : IBranchGetter { public Entity Left(Unionf node) => node.Left; public Entity Right(Unionf node) => node.Right; } + private struct UnionfBranchGetter : IBranchGetter { public readonly Entity Left(Unionf node) => node.Left; public readonly Entity Right(Unionf node) => node.Right; } internal static IEnumerable LinearChildren(Entity expr) => LinearChildren(expr); } partial record Intersectionf { - private struct IntersectionfBranchGetter : IBranchGetter { public Entity Left(Intersectionf node) => node.Left; public Entity Right(Intersectionf node) => node.Right; } + private struct IntersectionfBranchGetter : IBranchGetter { public readonly Entity Left(Intersectionf node) => node.Left; public readonly Entity Right(Intersectionf node) => node.Right; } internal static IEnumerable LinearChildren(Entity expr) => LinearChildren(expr); }