1
0
forked from VimPlug/jedi

A few small performances improvements on the diff parser.

This commit is contained in:
Dave Halter
2017-01-25 21:12:13 +01:00
parent 551c122cf8
commit f2db0dceb4

View File

@@ -99,7 +99,7 @@ def _update_positions(nodes, line_offset):
children = node.children
except AttributeError:
# Is a leaf
node.start_pos = node.start_pos[0] + line_offset, node.start_pos[1]
node.line += line_offset
else:
_update_positions(children, line_offset)
@@ -386,7 +386,8 @@ class _NodesStackNode(object):
def close(self):
children = []
for children_part, line_offset in self.children_groups:
_update_positions(children_part, line_offset)
if line_offset != 0:
_update_positions(children_part, line_offset)
children += children_part
self.tree_node.children = children
# Reset the parents