aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 12:05:21 +0800
committerGravatar Runxi Yu2026-03-06 12:05:21 +0800
commitdb494f32910a870320eccfa015ada681a3d3f691 (patch)
treecbdf90baff04416d925667824d98221938ed4cf6
parentinternal/iolimit: Add CappedCaptureWriter (diff)
signatureNo signature
format/pack/ingest: I don't think we need to use a clone there v0.1.61
-rw-r--r--format/pack/ingest/cache.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/format/pack/ingest/cache.go b/format/pack/ingest/cache.go
index 9c0b7a4f..3b4bf31a 100644
--- a/format/pack/ingest/cache.go
+++ b/format/pack/ingest/cache.go
@@ -34,20 +34,20 @@ func newDeltaBaseCache(maxBytes int64) *deltaBaseCache {
}
}
-// get returns a cloned cache entry for recordIdx.
+// get returns one cache entry for recordIdx.
func (cache *deltaBaseCache) get(recordIdx int) (objecttype.Type, []byte, bool) {
value, ok := cache.lru.Get(deltaBaseCacheKey{recordIdx: recordIdx})
if !ok {
return objecttype.TypeInvalid, nil, false
}
- return value.realType, append([]byte(nil), value.content...), true
+ return value.realType, value.content, true
}
-// add stores a cloned cache entry for recordIdx.
+// add stores one cache entry for recordIdx.
func (cache *deltaBaseCache) add(recordIdx int, realType objecttype.Type, content []byte) {
cache.lru.Add(deltaBaseCacheKey{recordIdx: recordIdx}, deltaBaseCacheValue{
realType: realType,
- content: append([]byte(nil), content...),
+ content: content,
})
}