Skip to content

Commit

Permalink
bring back tmhash
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Jun 22, 2020
1 parent 6fdcf67 commit b33003d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion store/rootmulti/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,14 @@ func newSimpleMap() *simpleMap {
func (sm *simpleMap) Set(key string, value []byte) {
sm.sorted = false

// The value is hashed, so you can
// check for equality with a cached value (say)
// and make a determination to fetch or not.
vhash := tmhash.Sum(value)

sm.kvs = append(sm.kvs, kv.Pair{
Key: []byte(key),
Value: value,
Value: vhash,
})
}

Expand Down

0 comments on commit b33003d

Please sign in to comment.