Closed GavinPHR closed 1 year ago
I noticed some discrepancies between the 2 different traversal orders. reversed() on line 108 returns an iterator and if it gets exhausted in the first iteration of the loop on 111, the subsequent result is incorrect. https://github.com/smartschat/cort/blob/2349f0308a4115acb89d442fe945533bdb3b70e2/cort/core/head_finders.py#L107-L112
reversed()
Suggest to change from to_traverse = reversed(tree) to to_traverse = list(reversed(tree) )
to_traverse = reversed(tree)
to_traverse = list(reversed(tree) )
I noticed some discrepancies between the 2 different traversal orders.
reversed()
on line 108 returns an iterator and if it gets exhausted in the first iteration of the loop on 111, the subsequent result is incorrect. https://github.com/smartschat/cort/blob/2349f0308a4115acb89d442fe945533bdb3b70e2/cort/core/head_finders.py#L107-L112Suggest to change from
to_traverse = reversed(tree)
toto_traverse = list(reversed(tree) )