Used ternary if/else in utils.lorem_ipsum.words().

This commit is contained in:
Michael Lelyakin 2016-12-14 14:36:34 -08:00 committed by Tim Graham
parent e5d3f98abc
commit fb1349ce8c
1 changed files with 1 additions and 4 deletions

View File

@ -103,10 +103,7 @@ def words(count, common=True):
If `common` is True, then the first 19 words will be the standard
'lorem ipsum' words. Otherwise, all words will be selected randomly.
"""
if common:
word_list = list(COMMON_WORDS)
else:
word_list = []
word_list = list(COMMON_WORDS) if common else []
c = len(word_list)
if count > c:
count -= c