Style thing really but I think one that makes sense. I renamed only by
what was already the most popular option.
Tested building against Go 1.27 to make sure I didn't mess that up.
Signed-off-by: Anders Eknert <anders.eknert@apple.com>
While we previously cached and reused trie traveral result from indexing
lookups, simply `clear`ing the tr.unordered map meant we still had to
allocate every time we appended to its slice values. This change fixes
that, along with some general cleanups in index.go — including an
audacious attempt to sneak in `util.Or` from Regal!
The improvement should reflect nicely across many benchmarks in OPA, as
pretty much all evaluations do indexing lookups. The Regal benchmark is
quite convincing, with 800k allocations saved in linting the Regal
bundle:
```
449648097 ns/op 1234775834 B/op 34886194 allocs/op
449672806 ns/op 1226927914 B/op 34045124 allocs/op
```
Signed-off-by: Anders Eknert <anders.eknert@apple.com>
Disabled by default. To enable, `not` future keyword must be present in capabilities and imported into Rego module.
Implements: #8391
Signed-off-by: Johan Fylling <johan.dev@fylling.se>