From 426f3e4e0a3ebba3ce380dcf5e3ebd9e3d270007 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Mon, 3 Apr 2023 12:12:40 +0900 Subject: [PATCH] revset: simplify evaluation of "all()" I think this is more readable, and apparently it produces slightly better code maybe because the compiler can determine that there are no unwanted markers. --- lib/src/default_revset_engine.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/default_revset_engine.rs b/lib/src/default_revset_engine.rs index 5457022d6..162a22416 100644 --- a/lib/src/default_revset_engine.rs +++ b/lib/src/default_revset_engine.rs @@ -549,7 +549,8 @@ impl<'index, 'heads> EvaluationContext<'index, 'heads> { // (and `remote_branches()`) specified in the revset expression. Alternatively, // some optimization rules could be removed, but that means `author(_) & x` // would have to test `:heads() & x`. - self.evaluate(&RevsetExpression::visible_heads().ancestors()) + let walk = self.composite_index.walk_revs(self.visible_heads, &[]); + Ok(Box::new(RevWalkRevset { walk })) } RevsetExpression::Commits(commit_ids) => Ok(self.revset_for_commit_ids(commit_ids)), RevsetExpression::Children(roots) => {