pariz / gountries

Gountries provides: Countries (ISO-3166-1), Country Subdivisions(ISO-3166-2), Currencies (ISO 4217), Geo Coordinates(ISO-6709) as well as translations, country borders and other stuff exposed as struct data.
MIT License
408 stars 67 forks source link

Add FindSubdivision(ByName|ByCode) #21

Closed tylerstillwater closed 4 years ago

tylerstillwater commented 6 years ago

This change does two things:

  1. Optimizes the loading and storage of subdivisions so that they are owned by their respective countries.
    1. This prevents having to create a new instance of the package with each call to Subdivisions(), which incurred significant overhead.
  2. Adds FindSubdivisionByName and FindSubdivisionByCode. This brings subdivisions on countries in line with the functionality offered by FindCountryByName and FindCountryByAlpha.