[meld] tree: Slight refactor of inorder_search_down()



commit 61d9dbbdc290d3a72b3aadaa7d857e4862d97d2d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 23 07:34:24 2016 +1000

    tree: Slight refactor of inorder_search_down()

 meld/tree.py | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/meld/tree.py b/meld/tree.py
index 4c68f706..d1d757fd 100644
--- a/meld/tree.py
+++ b/meld/tree.py
@@ -169,19 +169,18 @@ class DiffTreeStore(Gtk.TreeStore):
             if child:
                 it = child
             else:
-                next = self.iter_next(it)
-                if next:
-                    it = next
+                next_it = self.iter_next(it)
+                if next_it:
+                    it = next_it
                 else:
-                    while 1:
+                    while True:
                         it = self.iter_parent(it)
-                        if it:
-                            next = self.iter_next(it)
-                            if next:
-                                it = next
-                                break
-                        else:
+                        if not it:
                             raise StopIteration()
+                        next_it = self.iter_next(it)
+                        if next_it:
+                            it = next_it
+                            break
             yield it
 
     def inorder_search_up(self, it):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]