Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
mix: rename var with a bit of self-explainatory code changes, and bet…
…ter output
  • Loading branch information
bom-d-van committed Dec 31, 2019
commit 6c5f01b435e1393d8da3abfd46ede4fe07392a51
2 changes: 1 addition & 1 deletion cmd/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
}

if db.Extended {
fmt.Println("file is extended.")
fmt.Println("file has been extended.")
}
}

Expand Down
8 changes: 4 additions & 4 deletions compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ func (whisper *Whisper) WriteHeaderCompressed() (err error) {
i += packInt(b, archive.blockCount, i)
i += packFloat32(b, archive.avgCompressedPointSize, i)

var mixSpec int
var mixSpecSize int
if archive.aggregationSpec != nil {
b[i] = byte(archive.aggregationSpec.Method)
i += ByteSize
i += packFloat32(b, archive.aggregationSpec.Percentile, i)
mixSpec = 5
mixSpecSize = ByteSize + FloatSize
}

i += packInt(b, archive.cblock.index, i)
Expand All @@ -114,9 +114,9 @@ func (whisper *Whisper) WriteHeaderCompressed() (err error) {
i += packInt(b, int(archive.stats.discard.oldInterval), i)
i += packInt(b, int(archive.stats.extended), i)

i += FreeCompressedArchiveInfoSize - mixSpec
i += FreeCompressedArchiveInfoSize - mixSpecSize

if FreeCompressedArchiveInfoSize < mixSpec {
if FreeCompressedArchiveInfoSize < mixSpecSize {
panic("out of FreeCompressedArchiveInfoSize") // a panic that should never happens
}
}
Expand Down