Permalink
Browse files

Update utils.py

Use list-comprehension to avoid forloop
  • Loading branch information...
Allianzcortex committed Sep 13, 2016
1 parent 8168dd9 commit 6ac68940b1661c07c6d2758695eb00510733976c
Showing with 1 addition and 4 deletions.
  1. +1 −4 zhihu_oauth/zhcls/utils.py
@@ -31,10 +31,7 @@ def remove_invalid_char(dirty, invalid_chars=None):
else:
invalid_chars = set(invalid_chars)
invalid_chars.update(DEFAULT_INVALID_CHARS)
clean = []
for c in dirty:
if c not in invalid_chars:
clean.append(c)
clean = [c for c in dirty if c not in invalid_chars]
return ''.join(clean)

0 comments on commit 6ac6894

Please sign in to comment.