From 0f1db555ed0cb261600df6533b8f2baf7babdc93 Mon Sep 17 00:00:00 2001 From: Charlie Egan Date: Mon, 10 Jun 2024 14:47:19 +0100 Subject: [PATCH] Skip nil check When using sync.Once this is not needed. Signed-off-by: Charlie Egan --- internal/lsp/completions/refs/used.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/lsp/completions/refs/used.go b/internal/lsp/completions/refs/used.go index 64bbfcea..f96bc38f 100644 --- a/internal/lsp/completions/refs/used.go +++ b/internal/lsp/completions/refs/used.go @@ -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 {