From 56b11069daed8797aedf848a55e8d1ecf794f8ca Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Sat, 10 Feb 2024 10:10:55 -0800 Subject: [PATCH] Little refactor in GetBabyInfo and GetFatherInfo --- .../RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs index 7cbf28c..9b9bdad 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs @@ -20,9 +20,8 @@ namespace RJW_Menstruation StringBuilder res = new StringBuilder(); - IEnumerable babiesdistinct = babies.Distinct(new RaceComparer()); int iteration = 0; - foreach (Pawn baby in babiesdistinct) + foreach (Pawn baby in babies.Distinct(new RaceComparer())) { int num = babies.Where(x => x.def.Equals(baby.def)).Count(); if (iteration > 0) res.Append(", "); @@ -43,9 +42,8 @@ namespace RJW_Menstruation if (!is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All) return res.Append(Translations.Dialog_FatherUnknown).ToString(); - IEnumerable babiesdistinct = babies.Distinct(new FatherComparer(mother)); int iteration = 0; - foreach (Pawn baby in babiesdistinct) + foreach (Pawn baby in babies.Distinct(new FatherComparer(mother))) { if (iteration > 0) res.Append(", "); res.Append(Utility.GetFather(baby, mother)?.LabelShort ?? Translations.Dialog_FatherUnknown);