Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

FEAT: add is_prev() method in Iterators API #888

Open
JanDorniak99 opened this issue Jan 21, 2021 · 0 comments
Open

FEAT: add is_prev() method in Iterators API #888

JanDorniak99 opened this issue Jan 21, 2021 · 0 comments

Comments

@JanDorniak99
Copy link
Contributor

FEAT: add is_prev() method in Iterators API

Rationale

For now we have in documentation of prev():

If the previous record exists, returns pmem::kv::status::OK, otherwise pmem::kv::status::NOT_FOUND is returned and the iterator position is undefined.

So if we are on the first element we will be on the undefined position after calling prev(). With is_prev() method, we could avoid this.

Description

To solve this problem we can simply add is_prev() method to iterators that support prev() method.

But probably better option will be to change documentation to:

If the previous record exists, returns pmem::kv::status::OK, otherwise pmem::kv::status::NOT_FOUND is returned and the iterator position doesn't change.

Because in the current implementation position really doesn't change. It is only undefined by documentation.

API Changes

add is_prev() method to iterators or change prev() documentation

@lukaszstolarczuk lukaszstolarczuk added the new need to be triaged label Jan 21, 2021
@lukaszstolarczuk lukaszstolarczuk removed the new need to be triaged label Aug 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants