Skip to content

Commit

Permalink
Update hash.go
Browse files Browse the repository at this point in the history
  • Loading branch information
diiyw authored Jul 10, 2024
1 parent 7fb22e9 commit b98dbab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ds/hash/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ func (s *HashMap) HMSet(values map[string][]byte) {

// HMGet gets the values of a hash
func (s *HashMap) HMGet(fields ...string) [][]byte {
values := make([][]byte, 0, len(fields))
for _, key := range fields {
values := make([][]byte, len(fields))
for i, key := range fields {
value, ok := s.data.Get(key)
if ok {
values = append(values, value)
values[i] = value
} else {
values = append(values, nil)
values[i] = nil
}
}
return values
Expand Down

0 comments on commit b98dbab

Please sign in to comment.