treap: refactor the Put() code into exported and unexported versions
What changed, and why it matters
This commit is a simple internal code cleanup. It splits the existing Put() function into a public wrapper and a private helper, with no change to behavior. There is no security issue here.
No action required. This is a non-functional refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change refactors Immutable.Put() in database/internal/treap/immutable.go so the exported method delegates to a new unexported put() method. The implementation logic is unchanged; the diff only adds a 5-line wrapper. This is preparatory work for a future batch put feature.
Changed components
database/internal/treap/immutable.goInspect captured patch +5 / −0
diff --git a/database/internal/treap/immutable.go b/database/internal/treap/immutable.go
index a6e13ff..0a05d13 100644
--- a/database/internal/treap/immutable.go
+++ b/database/internal/treap/immutable.go
@@ -106,6 +106,11 @@ func (t *Immutable) Get(key []byte) []byte {
// Put inserts the passed key/value pair.
func (t *Immutable) Put(key, value []byte) *Immutable {
+ return t.put(key, value)
+}
+
+// put inserts the passed key/value pair.
+func (t *Immutable) put(key, value []byte) *Immutable {
// Use an empty byte slice for the value when none was provided. This
// ultimately allows key existence to be determined from the value since
// an empty byte slice is distinguishable from nil.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.