perf: replace multiple if statements with switch
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"message-pusher/common"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -55,10 +54,6 @@ func InitOptionMap() {
|
||||
}
|
||||
|
||||
func UpdateOption(key string, value string) error {
|
||||
if key == "StatEnabled" && value == "true" && !common.RedisEnabled {
|
||||
return errors.New("未启用 Redis,无法启用统计功能")
|
||||
}
|
||||
|
||||
// Save to database first
|
||||
option := Option{
|
||||
Key: key,
|
||||
|
||||
Reference in New Issue
Block a user