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