Show More
@@ -476,11 +476,15 b' def _optimize(x, small):' | |||||
476 | o = _optimize(x[1], small) |
|
476 | o = _optimize(x[1], small) | |
477 | order = x[2] |
|
477 | order = x[2] | |
478 | return o[0], (op, o[1], order) |
|
478 | return o[0], (op, o[1], order) | |
479 |
elif op in ('dagrange', 'range' |
|
479 | elif op in ('dagrange', 'range'): | |
480 | wa, ta = _optimize(x[1], small) |
|
480 | wa, ta = _optimize(x[1], small) | |
481 | wb, tb = _optimize(x[2], small) |
|
481 | wb, tb = _optimize(x[2], small) | |
482 | order = x[3] |
|
482 | order = x[3] | |
483 | return wa + wb, (op, ta, tb, order) |
|
483 | return wa + wb, (op, ta, tb, order) | |
|
484 | elif op in ('parent', 'ancestor'): | |||
|
485 | w, t = _optimize(x[1], small) | |||
|
486 | order = x[3] | |||
|
487 | return w, (op, t, x[2], order) | |||
484 | elif op == 'list': |
|
488 | elif op == 'list': | |
485 | ws, ts = zip(*(_optimize(y, small) for y in x[1:])) |
|
489 | ws, ts = zip(*(_optimize(y, small) for y in x[1:])) | |
486 | return sum(ws), (op,) + ts |
|
490 | return sum(ws), (op,) + ts |
General Comments 0
You need to be logged in to leave comments.
Login now