Permalink
Browse files

use python's builtin all() function in check function

  • Loading branch information...
1 parent 2efafbb commit 4d161b6e7577c60b28d16fe5eb42e52e48959f44 @shawnps committed Feb 4, 2012
Showing with 1 addition and 4 deletions.
  1. +1 −4 jcconv/jcconv.py
View
@@ -88,10 +88,7 @@ def check(text, char_set_type):
char_set = []
for set in jcconv.char_sets[char_set_type]:
char_set.extend(set.split(' '))
- for text_char in text:
- if not text_char in char_set:
- return False
- return True
+ return all([text_char in char_set for text_char in text])
# define character sets used in japanese
class jcconv:

0 comments on commit 4d161b6

Please sign in to comment.