From: Oleg Broytman Date: Thu, 11 Jun 2020 15:37:20 +0000 (+0300) Subject: Refactor(phd.py): Unroll tuple assignments X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=209af63ea2a301e34c6bb39be07706df66d93db7;p=phdru.name%2Fphdru.name.git Refactor(phd.py): Unroll tuple assignments Avoid tuple creation/split in the loop. --- diff --git a/phd.py b/phd.py index f51df69..eb50b31 100644 --- a/phd.py +++ b/phd.py @@ -118,9 +118,11 @@ class phd(Template): for key in sorted(blog): for blog_post in sorted(blog[key]): if current_blog_post: - prev_key, prev_blog_post = current_key, current_blog_post + prev_key = current_key + prev_blog_post = current_blog_post if next_blog_post: - current_key, current_blog_post = next_key, next_blog_post + current_key = next_key + current_blog_post = next_blog_post next_key = key next_blog_post = blog_post if current_blog_post and (current_key == ymd) and \