From c5e7ad0c4f1a4e491401dd2478d42c045117d834 Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Wed, 22 May 2019 12:25:32 +0200 Subject: [PATCH] refactor --- TMI-practicum/Program.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/TMI-practicum/Program.cs b/TMI-practicum/Program.cs index 72ce782..aea1ce6 100644 --- a/TMI-practicum/Program.cs +++ b/TMI-practicum/Program.cs @@ -79,17 +79,7 @@ namespace TMI_practicum solved.Contains(new Intersection(intersection.X, intersection.Y - 1e-15)) ) continue; - bool found = false; - - foreach (var ints in solved) - { - if (Math.Abs(ints.X - intersection.X) < 1e-12 && - Math.Abs(ints.Y - intersection.Y) < 1e-12) - { - found = true; - break; - } - } + bool found = solved.Any(ints => Math.Abs(ints.X - intersection.X) < 1e-12 && Math.Abs(ints.Y - intersection.Y) < 1e-12); if (found) continue;