Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion opendm/rollingshutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
DEFAULT_RS_READOUT = 30 # Just a guess

def make_model_key(make, model):
return ("%s %s" % (make.strip(), model.strip())).lower().strip()
# Use f-string for faster string formatting, and merge .strip().lower().strip() to a single .strip().lower()
# -> str.strip() returns a new string, and chaining is unnecessary as whitespace trimmed in the first pass.
# Since we build a string with no extra spaces introduced, one trim before lower is sufficient.
return f"{make.strip()} {model.strip()}".strip().lower()

warn_db_missing = {}
info_db_found = {}
Expand Down