Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Refactor initialization of range options#681

Merged
vweevers merged 1 commit intomasterfrom
refactor-range-options
Oct 13, 2019
Merged

Refactor initialization of range options#681
vweevers merged 1 commit intomasterfrom
refactor-range-options

Conversation

@vweevers
Copy link
Copy Markdown
Member

Ref #680.

@vweevers vweevers added semver-patch Bug fixes that are backward compatible refactor Requires or pertains to refactoring labels Oct 12, 2019
Comment thread binding.cc
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
Copy Markdown
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
Copy Markdown
Member Author

vweevers commented Oct 12, 2019

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

Comment thread binding.cc
Comment on lines -720 to +721
leveldb::Slice* start_;
std::string* start_;
Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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