diff --git a/calc.go b/calc.go index c108af9..433f3b2 100644 --- a/calc.go +++ b/calc.go @@ -370,9 +370,7 @@ func (c *Calc) EvalItem(item string) error { } switch item { - case "?": - fallthrough - case "help": + case "?", "help": c.PrintHelp() default: diff --git a/interpreter.go b/interpreter.go index 87e948b..8fb3bb3 100644 --- a/interpreter.go +++ b/interpreter.go @@ -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),