diff markup/path.py @ 73:1da51d718391 trunk

Some more performance tweaks.
author cmlenz
date Wed, 12 Jul 2006 18:47:39 +0000
parents dd73921530e8
children f5ec6d4a61e4
line wrap: on
line diff
--- a/markup/path.py
+++ b/markup/path.py
@@ -123,10 +123,13 @@
                     yield kind, data, pos
                     depth = 1
                     while depth > 0:
-                        ev = stream.next()
-                        depth += {START: 1, END: -1}.get(ev[0], 0)
-                        yield ev
-                        test(*ev)
+                        subkind, subdata, subpos = stream.next()
+                        if subkind is START:
+                            depth += 1
+                        elif subkind is END:
+                            depth -= 1
+                        yield subkind, subdata, subpos
+                        test(subkind, subdata, subpos)
                 elif result:
                     yield result
         return Stream(_generate())
Copyright (C) 2012-2017 Edgewall Software