Skip to content

Commit

Permalink
fewer lines of code (#589)
Browse files Browse the repository at this point in the history
Reduce the number of similar lines in the football utility module.
  • Loading branch information
AgnijDave committed Mar 20, 2022
1 parent 8b7b01e commit c5d7738
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sportsipy/fb/fb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ def _parse_squad_name(team_id):
string
Returns a ``string`` of the parsed team's name.
"""
name = team_id.replace(' FC', '')
name = name.replace('FC ', '')
name = name.replace(' CF', '')
name = name.replace('CF ', '')
name = name.lower()
name = name.strip()
irrelevant = [' FC', ' CF', 'FC ', 'CF ']
for val in irrelevant:
team_id = team_id.replace(val, '')
name = team_id.lower().strip()
return name


Expand Down

0 comments on commit c5d7738

Please sign in to comment.