mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-30 11:36:37 +08:00
optimize code structure
This commit is contained in:
@@ -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]))
|
||||
|
||||
Reference in New Issue
Block a user