Closed hannob closed 4 years ago
Note to myself: in some functions we can reduce complexity and depth of if clauses by using earlier exits.
Example:
before
if r.status == 200: if binary: return r.data return r.data.decode('ascii', errors='ignore') return ""
after
if r.status != 200: return "" if binary: return r.data return r.data.decode('ascii', errors='ignore')
I only found this one instance where this is easily possible, fixed now: https://github.com/hannob/snallygaster/commit/573042daa7dd5255d8c4c487321315d3d749fa3b
Note to myself: in some functions we can reduce complexity and depth of if clauses by using earlier exits.
Example:
before
after