Skip to content

Commit

Permalink
Use comprehension in it_IT address provider to populate cities for pe…
Browse files Browse the repository at this point in the history
…rformance (#2043)
  • Loading branch information
sevdog authored Jun 3, 2024
1 parent e0e0460 commit 2ad1315
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions faker/providers/address/it_IT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@


def getcities(fulldict):
cities = []
for cap in fulldict:
for c in fulldict[cap]:
cities.append(c[0]) if c[0] not in cities else cities
return cities
return list({c[0] for _cap, cities in fulldict.items() for c in cities})


class Provider(AddressProvider):
Expand Down

0 comments on commit 2ad1315

Please sign in to comment.