Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(tm2/bft/fail): use sync.Once instead of Getenv on each call (#2805)
minor change spotted when browsing tm2 code. fail.Fail is called a lot in hot paths, like in the tm2 state machine. This avoids calling os.Getenv each time, which actually does a [bunch of stuff](https://github.com/golang/go/blob/ae8708f7441b24dac126122c5365327d29fa0012/src/syscall/env_unix.go#L69-L88), even when there is no associated env var.
- Loading branch information