trie: rebase

This commit is contained in:
Gary Rong 2025-08-22 14:28:56 +08:00
parent d273d817cb
commit 94a0320741

View file

@ -18,7 +18,6 @@ package trie
import (
"maps"
"slices"
"sync"
)
@ -147,18 +146,10 @@ func (t *prevalueTracer) hasList(list [][]byte) []bool {
}
// values returns a list of values of the cached trie nodes.
func (t *prevalueTracer) values() [][]byte {
func (t *prevalueTracer) values() map[string][]byte {
t.lock.RLock()
defer t.lock.RUnlock()
return slices.Collect(maps.Values(t.data))
}
func (t *prevalueTracer) keys() []string {
return slices.Collect(maps.Keys(t.data))
}
func (t *prevalueTracer) getMap() map[string][]byte {
return maps.Clone(t.data)
}