diff options
author | Jason Gross <jagro@google.com> | 2018-08-29 17:55:15 -0400 |
---|---|---|
committer | Jason Gross <jagro@google.com> | 2018-08-29 17:55:18 -0400 |
commit | d0d6431ba6049b918ecb6d65dae360a2505fddee (patch) | |
tree | 91bf066a80f9f4e8df3df9f844b8fa46612d01b2 /src | |
parent | 8810ec44a7f538b65624a31ed7fe53d0a1569e79 (diff) |
Improve speed of do_with_exactly_one_hyp tactic
We assume that there are many hypotheses, and that running [tac] is
just as fast to succeed as to fail.
Diffstat (limited to 'src')
-rw-r--r-- | src/Util/Tactics/DoWithHyp.v | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Util/Tactics/DoWithHyp.v b/src/Util/Tactics/DoWithHyp.v index 3c068fe01..cee21b6d9 100644 --- a/src/Util/Tactics/DoWithHyp.v +++ b/src/Util/Tactics/DoWithHyp.v @@ -1,3 +1,4 @@ +Require Import Crypto.Util.Tactics.Test. Require Import Crypto.Util.Tactics.Not. Require Export Crypto.Util.FixCoqMistakes. @@ -11,7 +12,8 @@ Ltac do_with_hyp' tac := Ltac do_with_exactly_one_hyp tac := match goal with | [ H : _ |- _ ] - => not (idtac; match goal with + => test (tac H); + not (idtac; match goal with | [ H' : _ |- _ ] => tryif constr_eq H H' then fail else tac H' end); tac H |