Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOD: use deleterange in flushdb #23

Merged
merged 2 commits into from
Sep 11, 2019
Merged

MOD: use deleterange in flushdb #23

merged 2 commits into from
Sep 11, 2019

Conversation

karelrooted
Copy link
Contributor

No description provided.

src/redis_db.cc Outdated Show resolved Hide resolved
src/redis_db.cc Outdated Show resolved Hide resolved
src/redis_db.cc Outdated
next_prefix.push_back(last_char);

iter->SeekForPrev(next_prefix);
while (iter->Valid()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify:
=>

// reversed seek the key til with prefix or end of the iterator
while (iter->Valid() && !iter->key().starts_with(prefix)) {
    iter->Prev();
}

Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@git-hulk git-hulk merged commit 87eb1dd into master Sep 11, 2019
@karelrooted karelrooted deleted the enhancement/flushdb branch September 12, 2019 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants