366 return smallbonus, x # single revisions are small |
366 return smallbonus, x # single revisions are small |
367 elif op == 'and': |
367 elif op == 'and': |
368 wa, ta = _optimize(x[1], True) |
368 wa, ta = _optimize(x[1], True) |
369 wb, tb = _optimize(x[2], True) |
369 wb, tb = _optimize(x[2], True) |
370 w = min(wa, wb) |
370 w = min(wa, wb) |
|
371 |
|
372 # (draft/secret/_notpublic() & ::x) have a fast path |
|
373 m = _match('_() & ancestors(_)', ('and', ta, tb)) |
|
374 if m and getsymbol(m[1]) in {'draft', 'secret', '_notpublic'}: |
|
375 return w, _build('_phaseandancestors(_, _)', m[1], m[2]) |
371 |
376 |
372 # (::x and not ::y)/(not ::y and ::x) have a fast path |
377 # (::x and not ::y)/(not ::y and ::x) have a fast path |
373 m = _matchonly(ta, tb) or _matchonly(tb, ta) |
378 m = _matchonly(ta, tb) or _matchonly(tb, ta) |
374 if m: |
379 if m: |
375 return w, _build('only(_, _)', *m[1:]) |
380 return w, _build('only(_, _)', *m[1:]) |