Skip to content

Commit

Permalink
Replcaed for loop by list comprehension
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Zailskas <[email protected]>
  • Loading branch information
felix-zailskas committed Nov 3, 2023
1 parent 6b97817 commit f0cb2d5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/database/database_dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ def get_lead_by_id(self, id_: int) -> Lead:
return LeadParser.parse_lead_from_dict(self.data[id_])

def get_all_leads(self) -> List[Lead]:
leads = []
for entry in self.data.values():
leads.append(LeadParser.parse_lead_from_dict(entry))
return leads
return [LeadParser.parse_lead_from_dict(entry) for entry in self.data.values()]

def update_lead(self, lead: Lead):
print(f"Updating database entry for lead#{lead.lead_id}")
Expand Down

0 comments on commit f0cb2d5

Please sign in to comment.