Skip to content

Commit

Permalink
wrap hooks in cmdTable
Browse files Browse the repository at this point in the history
  • Loading branch information
xgzlucario committed Oct 26, 2023
1 parent e4eb2cc commit 8e865ce
Show file tree
Hide file tree
Showing 3 changed files with 248 additions and 377 deletions.
4 changes: 2 additions & 2 deletions codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ func (s *Decoder) ParseRecord() (op Operation, res [][]byte, err error) {
return 0, nil, base.ErrParseRecordLine
}

argsNum := cmdTable[op].ArgsNum
argsNum := cmdTable[op].argsNum
res = make([][]byte, 0, argsNum)

// parses args.
for j := 0; j < argsNum; j++ {
for j := 0; j < int(argsNum); j++ {
i := bytes.IndexByte(line, SepChar)
if i <= 0 {
return 0, nil, base.ErrParseRecordLine
Expand Down
Loading

0 comments on commit 8e865ce

Please sign in to comment.