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
......@@ -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)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment