Little cleanups and removal of unnecessary checks

This commit is contained in:
lutepickle 2022-08-27 22:01:39 -07:00
parent 66e2b3494b
commit 84d5ffa8b7
5 changed files with 11 additions and 37 deletions

View File

@ -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;
}

View File

@ -224,12 +224,8 @@ namespace RJW_Menstruation
{
if (notcum || DNA == null || volume < 1.0f) return;
List<IngestionOutcomeDoer> 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<string> 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();

View File

@ -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);
}
}

View File

@ -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);

View File

@ -81,8 +81,7 @@ namespace RJW_Menstruation
if (allvaginas != null) return allvaginas;
allvaginas = new HashSet<HediffDef>();
List<HediffDef> allHediffs = DefDatabase<HediffDef>.AllDefsListForReading;
foreach(HediffDef hediffDef in allHediffs)
foreach(HediffDef hediffDef in DefDatabase<HediffDef>.AllDefsListForReading)
{
if (hediffDef.comps.NullOrEmpty()) continue;
foreach (HediffCompProperties comp in hediffDef.comps)