Skip to content

Commit

Permalink
better switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas von Dein committed Jan 15, 2025
1 parent 43fcf43 commit e5dfad1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions calc.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,7 @@ func (c *Calc) EvalItem(item string) error {
}

switch item {
case "?":
fallthrough
case "help":
case "?", "help":
c.PrintHelp()

default:
Expand Down
4 changes: 1 addition & 3 deletions interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ func (i *Interpreter) CallLuaFunc(funcname string, items []float64) (float64, er
funcname, LuaFuncs[funcname].numargs))

switch LuaFuncs[funcname].numargs {
case 0:
fallthrough
case 1:
case 0, 1:
// 1 arg variant
if err := LuaInterpreter.CallByParam(lua.P{
Fn: LuaInterpreter.GetGlobal(funcname),
Expand Down

0 comments on commit e5dfad1

Please sign in to comment.