Skip to content

Commit

Permalink
Optimizations (#91)
Browse files Browse the repository at this point in the history
Optimized seekprefix watch performance.
  • Loading branch information
absolutelightning authored Jun 13, 2024
1 parent ca0bde4 commit 2bfc0e1
Show file tree
Hide file tree
Showing 13 changed files with 418 additions and 215 deletions.
7 changes: 5 additions & 2 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,14 @@ func findChild[T any](n Node[T], c byte) (Node[T], int) {
}

func getTreeKey(key []byte) []byte {
return append([]byte{'^'}, append(key, '$')...)
return append(key, '$')
}

func getKey(key []byte) []byte {
return key[1 : len(key)-1]
if len(key) == 0 {
return key
}
return key[:len(key)-1]
}

func (t *Txn[T]) removeChild(n Node[T], c byte) Node[T] {
Expand Down
Loading

0 comments on commit 2bfc0e1

Please sign in to comment.