From 5f50ef1eed06cfcfcbf98ee1801bc517350f3515 Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 27 Jun 2024 12:40:38 +1000 Subject: [PATCH] Fix for carbuna --- projects/GKCore/GDModel/GDMLocationRecord.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/GKCore/GDModel/GDMLocationRecord.cs b/projects/GKCore/GDModel/GDMLocationRecord.cs index 02ab14409..e74fff6d1 100644 --- a/projects/GKCore/GDModel/GDMLocationRecord.cs +++ b/projects/GKCore/GDModel/GDMLocationRecord.cs @@ -208,8 +208,9 @@ public GDMList GetFullNames(GDMTree tree, ATDEnumeration atdEnu } // search of intersections of location names and intersections of top levels/names - for (int i = 0; i < fNames.Count; i++) { - var locName = fNames[i]; + var q = new Queue(fNames); + while (q.Count>0) { + var locName = q.Dequeue(); string nVal = (abbreviations && !string.IsNullOrEmpty(locName.Abbreviation)) ? locName.Abbreviation : locName.StringValue; bool wasJoin = false; @@ -225,17 +226,18 @@ public GDMList GetFullNames(GDMTree tree, ATDEnumeration atdEnu var differences = GDMCustomDate.GetDifference(topDate, locName.Date.Value); foreach (var difference in differences) { if (!difference.IsEmpty()) { - result.Add(new GDMLocationName(nVal, difference)); + q.Enqueue(new GDMLocationName(nVal, difference)); } } wasJoin = true; + break; } } - // if (!wasJoin) { + if (!wasJoin) { result.Add(new GDMLocationName(nVal, locName.Date.Value)); - // } + } } }