optimize code structure

This commit is contained in:
hdt3213
2022-04-11 15:49:15 +08:00
parent 374606f6f1
commit e378731a26
6 changed files with 28 additions and 20 deletions

View File

@@ -164,20 +164,6 @@ func (db *DB) GetUndoLogs(cmdLine [][]byte) []CmdLine {
return undo(db, cmdLine[1:])
}
// execWithLock executes normal commands, invoker should provide locks
func (db *DB) execWithLock(cmdLine [][]byte) redis.Reply {
cmdName := strings.ToLower(string(cmdLine[0]))
cmd, ok := cmdTable[cmdName]
if !ok {
return protocol.MakeErrReply("ERR unknown command '" + cmdName + "'")
}
if !validateArity(cmd.arity, cmdLine) {
return protocol.MakeArgNumErrReply(cmdName)
}
fun := cmd.executor
return fun(db, cmdLine[1:])
}
// GetRelatedKeys analysis related keys
func GetRelatedKeys(cmdLine [][]byte) ([]string, []string) {
cmdName := strings.ToLower(string(cmdLine[0]))