[Solved] C# Lookup ptimisation suggestion are welcome

Neater, more linq: var data = GetData(); foreach (var v0 in data) { if (v0.Key.Item3 != string.Empty) continue; //Get all related data var tr_line = data[v0.Key]; sb.AppendLine(tr_line.First()); var hhLines = from v1 in data where v1.Key.Item2 == string.Empty && v1.Key.Item1 == v0.Key.Item1 select data[v1.Key]; foreach (var hh_line in hhLines) { sb.AppendLine(hh_line.First()); var grouping = v0; … Read more