diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs index 319f64a..4a5f045 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -148,14 +148,10 @@ namespace RJW_Menstruation if (o.IsNull) removeList.Add(o); if (o.DefName == def.defName) return true; } - if (!removeList.NullOrEmpty()) + foreach (HybridInformations o in removeList) { - foreach (HybridInformations o in removeList) - { - HybridOverride.Remove(o); - } + HybridOverride.Remove(o); } - removeList.Clear(); return false; } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs index d969e18..59941db 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs @@ -224,12 +224,8 @@ namespace RJW_Menstruation { if (notcum || DNA == null || volume < 1.0f) return; - List doers = DNA.ingestionOutcomeDoers; - - if (!doers.NullOrEmpty()) for (int i = 0; i < doers.Count; i++) - { - doers[i].DoIngestionOutcome(pawn, CumThing); - } + foreach (IngestionOutcomeDoer doer in DNA.ingestionOutcomeDoers) + doer.DoIngestionOutcome(pawn, CumThing); } protected void CutMinor() @@ -238,7 +234,7 @@ namespace RJW_Menstruation } } - public class CumMixture : Cum, IDisposable + public class CumMixture : Cum { protected List cums; public bool ispurecum = true; @@ -260,12 +256,6 @@ namespace RJW_Menstruation ispurecum = pure; } - public void Dispose() - { - cums.Clear(); - - } - public override void ExposeData() { base.ExposeData(); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 3fb1aef..892a780 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -845,7 +845,6 @@ namespace RJW_Menstruation { cums.Remove(cum); } - removecums.Clear(); cumd = TotalCumPercent - cumd; if (totalleak >= 1.0f) AfterCumOut(); AfterFluidOut(cumd); @@ -882,7 +881,6 @@ namespace RJW_Menstruation { cums.Remove(cum); } - removecums.Clear(); cumd = TotalCumPercent - cumd; AfterFluidOut(cumd); return outcum; @@ -915,7 +913,6 @@ namespace RJW_Menstruation { cums.Remove(cum); } - removecums.Clear(); return new CumMixture(Pawn, totalleak, cumlabels, color, mixtureDef, pure); } @@ -1244,16 +1241,14 @@ namespace RJW_Menstruation if (pregnant && (!Configurations.UseMultiplePregnancy || !Configurations.EnableHeteroOvularTwins)) { eggs.Clear(); - deadeggs.Clear(); return true; } - else if (!deadeggs.NullOrEmpty()) + else { foreach (Egg egg in deadeggs) { eggs.Remove(egg); } - deadeggs.Clear(); } return pregnant; } @@ -1335,13 +1330,9 @@ namespace RJW_Menstruation if (egg.lifespanhrs < 0) deadeggs.Add(egg); } } - if (!deadeggs.NullOrEmpty()) + foreach (Egg egg in deadeggs) { - foreach (Egg egg in deadeggs) - { - eggs.Remove(egg); - } - deadeggs.Clear(); + eggs.Remove(egg); } } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs index 4df0978..e61af20 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs @@ -404,10 +404,8 @@ namespace RJW_Menstruation DoSubRow(sublist.GetRect(rowH), key, extension, removeelements); } } - if (!removeelements.NullOrEmpty()) foreach (string key in removeelements) - { - extension.hybridInfo.Remove(key); - } + foreach (string key in removeelements) + extension.hybridInfo.Remove(key); sublist.End(); Widgets.DrawHighlightIfMouseover(rect); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs index 141d5c5..f7b7eb0 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -81,8 +81,7 @@ namespace RJW_Menstruation if (allvaginas != null) return allvaginas; allvaginas = new HashSet(); - List allHediffs = DefDatabase.AllDefsListForReading; - foreach(HediffDef hediffDef in allHediffs) + foreach(HediffDef hediffDef in DefDatabase.AllDefsListForReading) { if (hediffDef.comps.NullOrEmpty()) continue; foreach (HediffCompProperties comp in hediffDef.comps)