wp
This commit is contained in:
@@ -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
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user