Skip to content

Commit

Permalink
ensure stdlib is loaded once for //eval.eval (#249)
Browse files Browse the repository at this point in the history
Previously, //eval.eval calls SafeStdScopeTuple function which rebuilds the stdlib. This is unnecessary as the function SafeStdScope uses sync.Once which avoids rebuilding the arrai stdlib. This commit ensures that //eval.eval loads stdlib once by calling SafeStdScope.
  • Loading branch information
nofun97 authored Feb 21, 2022
1 parent 4b27f5e commit d66666f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/std_eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func contextualEval(ctx context.Context, config EvalConfig, v rel.Value) (rel.Va
}
scope = scope.With("//", localLib)
} else {
scope = scope.With("//", SafeStdScopeTuple())
scope = scope.Update(SafeStdScope())
}
for e := config.scopes.Enumerator(); e.MoveNext(); {
name, value := e.Current()
Expand Down

0 comments on commit d66666f

Please sign in to comment.