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 {
case "?":
fallthrough
case "help":
case "?", "help":
c.PrintHelp()
default:

View File

@@ -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),