Skip to content

Commit

Permalink
leveldb/table: baseLg should unsigned integer
Browse files Browse the repository at this point in the history
  • Loading branch information
syndtr committed Aug 15, 2020
1 parent a38fa22 commit 5c35d60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion leveldb/opt/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func (o *Options) GetWriteL0SlowdownTrigger() int {
}

func (o *Options) GetFilterBaseLg() int {
if o == nil || o.FilterBaseLg == 0 {
if o == nil || o.FilterBaseLg <= 0 {
return DefaultFilterBaseLg
}
return o.FilterBaseLg
Expand Down
4 changes: 2 additions & 2 deletions leveldb/table/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ type filterWriter struct {
buf util.Buffer
nKeys int
offsets []uint32
baseLg int
baseLg uint
}

func (w *filterWriter) add(key []byte) {
Expand Down Expand Up @@ -370,7 +370,7 @@ func NewWriter(f io.Writer, o *opt.Options) *Writer {
// filter block
if w.filter != nil {
w.filterBlock.generator = w.filter.NewGenerator()
w.filterBlock.baseLg = o.GetFilterBaseLg()
w.filterBlock.baseLg = uint(o.GetFilterBaseLg())
w.filterBlock.flush(0)
}
return w
Expand Down

0 comments on commit 5c35d60

Please sign in to comment.