Skip to content
Snippets Groups Projects
Commit afc81762 authored by Aksel Baardsen's avatar Aksel Baardsen
Browse files

logical error allowing for duplicate species fixed for real this time..

parent f804afa2
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ func GetCountryByCode(code, limit string) (Country, int) {
// and checks if the country-code is correct
if country.Code == species.Results[i].CountryCode {
// and checks that the species is unique
if species.Results[i].SpeciesKey != 0 && contains(country.SpeciesKey, species.Results[i].SpeciesKey) {
if species.Results[i].SpeciesKey > 0 && !contains(country.SpeciesKey, species.Results[i].SpeciesKey) {
country.Species = append(country.Species, species.Results[i].Species)
country.SpeciesKey = append(country.SpeciesKey, species.Results[i].SpeciesKey)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment