- ID
- 0e63f161-ea3f-4d82-8b32-96aaa35ab886
BE-5302 Replace double for loop list comprehension with pydash 'flatten'
- source :: https://hungryroot.atlassian.net/browse/BE-5302
- tags :: Hungryroot API Project
- epic :: EP-411 Eng Parking Lot
- sprint :: HR BE Sprint 101
- status :: Status - Complete
Tasks
DONE Fix double loop list comprehension
- ID
- a6674982-c01b-e833-97fa-ecdb9475238e
Description
Instead of:
#+begin_src python
candidate_list = {c for sublist in candidates.values() for c in sublist}
#+end_src
which can be hard to read. Since we already have pydash and use it in many places, we can change this to something like:
#+begin_src python
from pydash import flatten as _flatten
candidate_list = set(_flatten(candidates.values()))
#+end_src