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

Refactor initialization of range options #681

Merged
merged 1 commit into from
Oct 13, 2019
Merged

Conversation

vweevers
Copy link
Member

Ref #680.

@vweevers vweevers added semver-patch Bug fixes that are backward compatible refactor Requires or pertains to refactoring labels Oct 12, 2019
std::string* gt = RangeOption(env, options, "gt");
std::string* gte = RangeOption(env, options, "gte");

if (!reverse && gte != NULL) start = new std::string(*gte);
Copy link
Member Author

Choose a reason for hiding this comment

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

Could also do start = gte (no copy), seeing as they all have the same lifetime, but I figured it'd be a useless optimization.

@vweevers
Copy link
Member Author

vweevers commented Oct 12, 2019

This is probably a good time for #573 - as well as some tests on null bytes?

Comment on lines -720 to +721
leveldb::Slice* start_;
std::string* start_;
Copy link
Member

Choose a reason for hiding this comment

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

Nice to get rid of this special case (the delete in destructor).

@vweevers vweevers merged commit 23dc7d2 into master Oct 13, 2019
@vweevers vweevers deleted the refactor-range-options branch October 13, 2019 06:15
vweevers added a commit to Level/rocksdb that referenced this pull request Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Requires or pertains to refactoring semver-patch Bug fixes that are backward compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants