Skip to content

Commit

Permalink
BAAS-23710: Reduce getFuncName calls in saveCtx
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvinnix committed Aug 4, 2023
1 parent 2486364 commit ec2a217
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,9 @@ func (vm *vm) peek() Value {
func (vm *vm) saveCtx(ctx *vmContext) {
ctx.prg, ctx.stash, ctx.privEnv, ctx.newTarget, ctx.result, ctx.pc, ctx.sb, ctx.args =
vm.prg, vm.stash, vm.privEnv, vm.newTarget, vm.result, vm.pc, vm.sb, vm.args
if vm.getFuncName() != "" {
ctx.funcName = vm.getFuncName()
funcName := vm.getFuncName()
if funcName != "" {
ctx.funcName = funcName
} else if ctx.prg != nil && ctx.prg.funcName != "" {
ctx.funcName = ctx.prg.funcName
}
Expand Down

0 comments on commit ec2a217

Please sign in to comment.