mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix(tui): faster cache algo
This commit is contained in:
parent
d41aa2bc72
commit
01c125b058
1 changed files with 2 additions and 2 deletions
|
|
@ -1,9 +1,9 @@
|
|||
package chat
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
"sync"
|
||||
)
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ func NewMessageCache() *MessageCache {
|
|||
|
||||
// generateKey creates a unique key for a message based on its content and rendering parameters
|
||||
func (c *MessageCache) GenerateKey(params ...any) string {
|
||||
h := sha256.New()
|
||||
h := fnv.New64a()
|
||||
for _, param := range params {
|
||||
h.Write(fmt.Appendf(nil, ":%v", param))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue