private void MakeSureResultExistsForSpecies(Species species) { if (results.ContainsKey(species)) { return; } results[species] = new SpeciesResult(species); }
private void MakeSureResultExistsForSpecies(Species species) { if (species == null) { throw new ArgumentException("species to add result to is null", nameof(species)); } lock (results) { if (results.ContainsKey(species)) { return; } results[species] = new SpeciesResult(species); } }