Skip to content

Commit

Permalink
Refactor findMethod to State#FindMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
elct9620 committed Nov 16, 2023
1 parent 05c4778 commit e3baf37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion class.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var methods = map[string]*Method{
},
}

func findMethod(mrb *State, recv Value, mid string) *Method {
func (mrb *State) FindMethod(recv Value, mid string) *Method {
if m, ok := methods[mid]; ok {
return m
}
Expand Down
2 changes: 1 addition & 1 deletion irep.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (ir *iRep) Execute(state *State) (Value, error) {
ci.stack = append(ci.stack, regs[int(a)+1:int(a)+ci.numArgs+1]...)

recv := regs[0]
method := findMethod(state, recv, ci.methodId)
method := state.FindMethod(recv, ci.methodId)

if method == nil {
regs[a] = nil
Expand Down

0 comments on commit e3baf37

Please sign in to comment.