better switch

This commit is contained in:
2025-01-15 10:28:35 +01:00
parent 43fcf43d1f
commit e5dfad1e35
2 changed files with 2 additions and 6 deletions

View File

@@ -370,9 +370,7 @@ func (c *Calc) EvalItem(item string) error {
} }
switch item { switch item {
case "?": case "?", "help":
fallthrough
case "help":
c.PrintHelp() c.PrintHelp()
default: default:

View File

@@ -116,9 +116,7 @@ func (i *Interpreter) CallLuaFunc(funcname string, items []float64) (float64, er
funcname, LuaFuncs[funcname].numargs)) funcname, LuaFuncs[funcname].numargs))
switch LuaFuncs[funcname].numargs { switch LuaFuncs[funcname].numargs {
case 0: case 0, 1:
fallthrough
case 1:
// 1 arg variant // 1 arg variant
if err := LuaInterpreter.CallByParam(lua.P{ if err := LuaInterpreter.CallByParam(lua.P{
Fn: LuaInterpreter.GetGlobal(funcname), Fn: LuaInterpreter.GetGlobal(funcname),