about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2021-12-18 11:01:23 -0500
committerBen Harris <ben@tilde.team>2021-12-18 11:01:23 -0500
commit06872beca5ce10f12e5429e185e11e92e8255924 (patch)
treed55ca2a059622d1816d7496b67e7b08aa1d9031a
parent9daa1e1424be8b86192174bc8e622cb2fd3387fb (diff)
fix warnings
-rw-r--r--aoc2021/Day18.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/aoc2021/Day18.cs b/aoc2021/Day18.cs
index eb13164..c8ea308 100644
--- a/aoc2021/Day18.cs
+++ b/aoc2021/Day18.cs
@@ -33,7 +33,7 @@ public sealed class Day18 : Day
 
     private static Tree<int> Add(Tree<int> a, Tree<int> b)
     {
-        var reduced = new Tree<int>(new Tree<int>.Node(null, -1) {Left = a.Root, Right = b.Root});
+        var reduced = new Tree<int>(new(null, -1) {Left = a.Root, Right = b.Root});
         Reduce(reduced);
         return reduced;
     }
@@ -72,9 +72,9 @@ public sealed class Day18 : Day
         {
             if (node.Data != -1 || node.DistanceToParent(t.Root) < 4) return false;
             var left = SiblingOf(node, n => n.Right, n => n.Left);
-            if (left != null) left.Data += node.Left.Data;
+            if (left != null) left.Data += node.Left!.Data;
             var right = SiblingOf(node, n => n.Left, n => n.Right);
-            if (right != null) right.Data += node.Right.Data;
+            if (right != null) right.Data += node.Right!.Data;
 
             node.Left = null;
             node.Right = null;