Skip to content

Commit

Permalink
Skip nil check (#819)
Browse files Browse the repository at this point in the history
When using sync.Once this is not needed.

Signed-off-by: Charlie Egan <charlie@styra.com>
  • Loading branch information
charlieegan3 authored Jun 10, 2024
1 parent d0def34 commit 96246a3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/lsp/completions/refs/used.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ func initialize() {
// See the rego above for more details on what's included and excluded.
// This function is run when the parse completes for a module.
func UsedInModule(ctx context.Context, module *ast.Module) ([]string, error) {
if pq == nil {
pqInitOnce.Do(initialize)
}
pqInitOnce.Do(initialize)

rs, err := pq.Eval(ctx, rego.EvalInput(module))
if err != nil {
Expand Down

0 comments on commit 96246a3

Please sign in to comment.