Skip to content

Commit

Permalink
Ensure deterministic ordering of keys when applying KVCache
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Aug 3, 2017
1 parent 7cf20ef commit e63f3bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion state/kvcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ func (c *MemKVCache) Commit(sub SimpleDB) error {

// applyCache will apply all the cache methods to the underlying store
func (c *MemKVCache) applyCache() {
for k, v := range c.cache.m {
for _, k := range c.cache.keysInRange(nil, nil) {
v := c.cache.m[k]
if v == nil {
c.store.Remove([]byte(k))
} else {
Expand Down

0 comments on commit e63f3bc

Please sign in to comment.