perf: handle easy case efficiently
This commit is contained in:
parent
661548a2fe
commit
3586337c56
1 changed files with 4 additions and 1 deletions
|
|
@ -35,7 +35,10 @@ private partial def kabstractAux (occs : Occurrences) (p : Expr) (pHeadIdx : Hea
|
|||
visitChildren ()
|
||||
|
||||
def kabstract {m} [MonadLiftT MetaM m] (e : Expr) (p : Expr) (occs : Occurrences := Occurrences.all) : m Expr := liftMetaM do
|
||||
(kabstractAux occs p p.toHeadIndex p.headNumArgs e 0).run' 1
|
||||
if p.isFVar && occs == Occurrences.all then
|
||||
pure $ e.abstract #[p] -- Easy case
|
||||
else
|
||||
(kabstractAux occs p p.toHeadIndex p.headNumArgs e 0).run' 1
|
||||
|
||||
end Meta
|
||||
end Lean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue