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

Implement len() and is_empty() methods on WriteBatch #78

Merged
merged 3 commits into from Oct 27, 2016
Merged

Implement len() and is_empty() methods on WriteBatch #78

merged 3 commits into from Oct 27, 2016

Conversation

kaedroho
Copy link
Contributor

@kaedroho kaedroho commented Oct 27, 2016

Part of #69

These changes we're ported from https://github.com/ngaut/rust-rocksdb/pull/22.

The original implementation named the len() method count(). I renamed it to len() to be more conventional with Rust.

count() in Rust usually means that you have to actually "count" something that you do not know the length of, such as an iterator. len() in Rust usually means that you already know the length and can return it quickly. Looking at the RocksDB source code, count is just a value stored in memory so I think it makes sense for it to be named len() in the Rust API.

@spacejam
Copy link
Member

👍

@spacejam spacejam merged commit a530558 into rust-rocksdb:master Oct 27, 2016
BusyJay pushed a commit to BusyJay/rust-rocksdb that referenced this pull request Jul 7, 2017
BusyJay pushed a commit to BusyJay/rust-rocksdb that referenced this pull request Jul 7, 2017
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

3 participants