From 6378812cc6fedad88ad8c595b35c2d27fd528058 Mon Sep 17 00:00:00 2001
From: David Amo <david.amo-gonzalez@ext.ec.europa.eu>
Date: Fri, 7 Jun 2024 15:40:47 +0100
Subject: [PATCH] Revert testing code

---
 VectoCore/VectoCore/OutputData/DeclarationReport.cs | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/VectoCore/VectoCore/OutputData/DeclarationReport.cs b/VectoCore/VectoCore/OutputData/DeclarationReport.cs
index 5aca3881c3..415dc256ad 100644
--- a/VectoCore/VectoCore/OutputData/DeclarationReport.cs
+++ b/VectoCore/VectoCore/OutputData/DeclarationReport.cs
@@ -266,13 +266,12 @@ namespace TUGraz.VectoCore.OutputData
 				var entry = new T();
 				entry.Initialize(runData, modData);
 				lock (Results) {
-					var existingResults = Results.Where(e =>
-						e.Mission == entry.Mission && e.LoadingType == entry.LoadingType && e.OVCMode == entry.OVCMode && e.VehicleClass == entry.VehicleClass).ToList();
-					bool areElectric = existingResults.All(e => e.LoadingType == LoadingType.ReferenceLoad);
-					if (existingResults.Count > 1)
+					var existingResults = Results.SingleOrDefault(e =>
+						e.Mission == entry.Mission && e.LoadingType == entry.LoadingType && e.OVCMode == entry.OVCMode && e.VehicleClass == entry.VehicleClass);
+					if (existingResults != null)
 					{
 						//We already have a result for this run stored, this can happen with iterative runs, in this case we have to remove the old result
-						Results.RemoveRange(1, existingResults.Count - 1);
+						Results.Remove(existingResults);
 					}
 
 					Results.Add(entry);
-- 
GitLab