google / google/leveldb

Improper condition test in FilterBlockReader::KeyMayMatch

Open
#171 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
39.4k
Forks
8.2k
PR merge metrics
No merged PRs in 30d

Description

Original [issue 165](https://code.google.com/p/leveldb/issues/detail?id=165) created by alghak on 2013-05-06T13:37:06.000Z:

In FilterBlockReader::KeyMayMatch(), the `else if (start == limit)` branch never get executed even when `start == limit`. The flow control always goes into the `if` branch because of the `start <= limit` condition test.
When met with empty filter, it's not necessary to call `policy_->KeyMayMatch` at all.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.