]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Refactor(phd.py): Unroll tuple assignments
authorOleg Broytman <phd@phdru.name>
Thu, 11 Jun 2020 15:37:20 +0000 (18:37 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 11 Jun 2020 15:37:20 +0000 (18:37 +0300)
Avoid tuple creation/split in the loop.

phd.py

diff --git a/phd.py b/phd.py
index f51df69d8aba61ee1d49b3d856f8c2b9d09114f5..eb50b31c1e47efaa037cc9d36549fabd9d80433d 100644 (file)
--- 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 \