This commit is contained in:
2026-06-10 06:18:45 +03:00
parent 4089ca40c9
commit 9ec86282ad
47 changed files with 3493 additions and 4502 deletions

View File

@@ -19,7 +19,7 @@ type InstantDeltaCompressor struct {
state *InstantDeltaCapturedState
}
func NewInstantDeltaCompressor(buf []byte, fracDigits byte) *InstantDeltaCompressor {
func NewInstantDeltaCompressor(fracDigits byte, buf []byte, payloadSize int) *InstantDeltaCompressor {
var coef float64 = 1
if fracDigits > 0 {
coef = math.Pow(10, float64(fracDigits))
@@ -28,10 +28,6 @@ func NewInstantDeltaCompressor(buf []byte, fracDigits byte) *InstantDeltaCompres
buf: buf,
coef: coef,
}
return s
}
func (s *InstantDeltaCompressor) RestoreState(payloadSize int) {
if payloadSize > 0 {
s.pos = payloadSize - 1 // завжди показує на h
// base value на початку
@@ -46,8 +42,13 @@ func (s *InstantDeltaCompressor) RestoreState(payloadSize int) {
log.Fatalf("bug: get last delta: %s", err)
}
}
return s
}
// func (s *InstantDeltaCompressor) RestoreState() {
// }
// func (s *InstantDeltaCompressor) Size() int {
// return s.pos
// }