From fb1349ce8cfd207ec5bbdb617dad75a73caee33b Mon Sep 17 00:00:00 2001 From: Michael Lelyakin Date: Wed, 14 Dec 2016 14:36:34 -0800 Subject: [PATCH] Used ternary if/else in utils.lorem_ipsum.words(). --- django/utils/lorem_ipsum.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/django/utils/lorem_ipsum.py b/django/utils/lorem_ipsum.py index a9459f4395..03426c152b 100644 --- a/django/utils/lorem_ipsum.py +++ b/django/utils/lorem_ipsum.py @@ -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